From 29b353d5d211b9dd253c4064207be9e16638aff5 Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 20 Oct 2010 16:28:16 +0530 Subject: [PATCH] [FIX] mrp: regression: production orders moves are wrongly done from 'Stock' to 'Stock' lp bug: https://launchpad.net/bugs/622948 fixed bzr revid: hmo@tinyerp.com-20101020105816-08af1r7unnxcagv0 --- addons/mrp/mrp.py | 2 +- addons/stock/stock.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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')