diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index d0402708f5f..12014f0fad8 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -745,7 +745,7 @@ class mrp_production(osv.osv): if rest_qty <= production_qty: production_qty = rest_qty if rest_qty > 0 : - stock_mov_obj.action_consume(cr, uid, [produce_product.id], production_qty, production.location_dest_id.id, context=context) + stock_mov_obj.action_consume(cr, uid, [produce_product.id], production_qty, context=context) for raw_product in production.move_lines2: new_parent_ids = [] diff --git a/addons/stock/stock.py b/addons/stock/stock.py index f6c5f1de554..fe984b10f22 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2215,7 +2215,7 @@ class stock_move(osv.osv): 'product_qty': quantity, 'product_uos_qty': uos_qty, 'state': move.state, - 'location_id': location_id + 'location_id': location_id or move.location_id.id, } if move.product_id.track_production and location_id: # IF product has checked track for production lot, move lines will be split by 1 @@ -2238,9 +2238,8 @@ class stock_move(osv.osv): update_val = { 'product_qty' : quantity_rest, 'product_uos_qty' : uos_qty_rest, - 'location_id': location_id + 'location_id': location_id or move.location_id.id } - self.write(cr, uid, [move.id], update_val) product_obj = self.pool.get('product.product')