diff --git a/addons/stock/stock.py b/addons/stock/stock.py index c5784541f68..209492c8bb9 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -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