From 7530d2818321ce0e71c79a0edc6bb9abc541816f Mon Sep 17 00:00:00 2001 From: Ravi Gohil Date: Wed, 2 Jul 2014 19:28:05 +0530 Subject: [PATCH] [FIX] mrp: production traceability Upstream traceability on produced goods (serial number on finished product) was broken due to wrong values in cache for production.move_lines2 after production. Refresh the value of production after each action_consume to make such the state of the cache is correct. opw 609450 Similar fix for manufactruing order not going in done state in some specific configrations (e.g. some components being phantom BOM). Again due to wrong cache state after consumption. opw 610515 Fixes #1296 --- addons/mrp/mrp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index aff1a51ffaa..a5d57114c37 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -795,6 +795,7 @@ class mrp_production(osv.osv): continue raw_product[0].action_consume(qty, raw_product[0].location_id.id, context=context) + production.refresh() if production_mode == 'consume_produce': # To produce remaining qty of final product @@ -820,6 +821,7 @@ class mrp_production(osv.osv): raise osv.except_osv(_('Warning!'), _('You are going to produce total %s quantities of "%s".\nBut you can only produce up to total %s quantities.') % ((subproduct_factor * production_qty), prod_name, rest_qty)) if rest_qty > 0 : stock_mov_obj.action_consume(cr, uid, [produce_product.id], (subproduct_factor * production_qty), context=context) + production.refresh() for raw_product in production.move_lines2: new_parent_ids = []