From ef4d8b2df037f86ad7da1e490fba2850db757171 Mon Sep 17 00:00:00 2001 From: kevin wang Date: Fri, 17 Oct 2014 16:16:28 +0200 Subject: [PATCH] [FIX] mrp: traceability of production When consuming product, the main_production_move is set as the source of production (used for consumed_for parameter) However the method action_consume now (since 661a204) returns the new moves (when spliting) instead of the original one. This means that the tracebility would fail. --- addons/mrp/mrp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index c239df0b3c5..1791450d345 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -918,8 +918,8 @@ class mrp_production(osv.osv): new_moves = stock_mov_obj.action_consume(cr, uid, [produce_product.id], (subproduct_factor * production_qty_uom), location_id=produce_product.location_id.id, restrict_lot_id=lot_id, context=context) stock_mov_obj.write(cr, uid, new_moves, {'production_id': production_id}, context=context) - if produce_product.product_id.id == production.product_id.id and new_moves: - main_production_move = new_moves[0] + if produce_product.product_id.id == production.product_id.id: + main_production_move = produce_product.id if production_mode in ['consume', 'consume_produce']: if wiz: