Merge lp:~openerp-dev/openobject-addons/6.1-opw-581120-rgo into lp:openobject-addons/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Approved
Approved by: Vinay Rana (OpenERP)
Approved revision: 7057
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-581120-rgo
Merge into: lp:openobject-addons/6.1
Diff against target: 19 lines (+4/-2)
1 file modified
stock/ (+4/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-581120-rgo
Reviewer Review Type Date Requested Status
Vinay Rana (OpenERP) (community) Approve
Naresh(OpenERP) Pending
Review via email:

Description of the change


To reproduce/for better understanding of the issue, please refer to the video attached to the comment #3 of lp:1068152.

Currently, the code in onchange_lot_id() stock/ does conversion from product's default UoM to the UoM selected in stock move, but it should be between UoM selected in stock move and reference UoM of that product, as the quantity value for lot is stored after converting it to reference UoM.

I have fixed this issue by doing the correct conversion. Kindly review the fix.


To post a comment you must log in.
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

The propose fix will solve the issue.

review: Approve
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :


This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Naresh Soni

Unmerged revisions

7057. By Ravi Gohil (OpenERP)

[FIX] stock: If we have a product configured with a default UoM whose UoM type is set to other than reference uom, and when creating production lot for this product, it shows QTY in reference UoM and not in default UoM, this causes wrong warning message when assigning lot while creating picking : (Maintenance Case : 581120)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/'
2--- stock/ 2012-10-05 07:47:57 +0000
3+++ stock/ 2012-11-05 11:33:31 +0000
4@@ -1740,11 +1740,13 @@
5 ctx.update({'raise-exception': True})
6 uom_obj = self.pool.get('product.uom')
7 product_obj = self.pool.get('product.product')
8- product_uom = product_obj.browse(cr, uid, product_id, context=ctx).uom_id
9+ product_uom_categ = product_obj.browse(cr, uid, product_id, context=ctx)
10+ product_ref_uom =, uid, [('category_id', '=', product_uom_categ), ('uom_type', '=', 'reference')], context=ctx)[0]
11+ product_ref_uom = uom_obj.browse(cr, uid, product_ref_uom, context=ctx)
12 prodlot = self.pool.get('stock.production.lot').browse(cr, uid, prodlot_id, context=ctx)
13 location = self.pool.get('stock.location').browse(cr, uid, loc_id, context=ctx)
14 uom = uom_obj.browse(cr, uid, uom_id, context=ctx)
15- amount_actual = uom_obj._compute_qty_obj(cr, uid, product_uom, prodlot.stock_available, uom, context=ctx)
16+ amount_actual = uom_obj._compute_qty_obj(cr, uid, product_ref_uom, prodlot.stock_available, uom, context=ctx)
17 warning = {}
18 if (location.usage == 'internal') and (product_qty > (amount_actual or 0.0)):
19 warning = {