[Fix] stock: stock_move_do_partial to properly set the production lot
authorsbh (Open ERP) <sbh@tinyerp.com>
Wed, 22 Sep 2010 06:54:59 +0000 (12:24 +0530)
committersbh (Open ERP) <sbh@tinyerp.com>
Wed, 22 Sep 2010 06:54:59 +0000 (12:24 +0530)
bzr revid: sbh@tinyerp.com-20100922065459-dzp65m06jiomu4rp

addons/stock/stock.py

index c578454..209492c 100644 (file)
@@ -2284,8 +2284,6 @@ class stock_move(osv.osv):
             product_price = partial_data.get('product_price',0.0)
             product_currency = partial_data.get('product_currency',False)
             prodlot_id = partial_data.get('prodlot_id',False)
-            if prodlot_id:
-                self.write(cr, uid, [move.id],{'prodlot_id': prodlot_id,})                      
             if move.product_qty == product_qty:
                 complete.append(move)
             elif move.product_qty > product_qty:
@@ -2354,6 +2352,8 @@ class stock_move(osv.osv):
             complete.append(move)
 
         for move in complete:
+            if prodlot_id:
+                self.write(cr, uid, [move.id],{'prodlot_id': prodlot_id,})                
             self.action_done(cr, uid, [move.id], context=context)
             if  move.picking_id.id :
                 # TOCHECK : Done picking if all moves are done