[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
This commit is contained in:
Ravi Gohil 2014-07-02 19:28:05 +05:30 committed by Martin Trigaux
parent 894143cb4c
commit 7530d28183
1 changed files with 2 additions and 0 deletions

View File

@ -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 = []