[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:
parent
894143cb4c
commit
7530d28183
|
@ -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 = []
|
||||
|
|
Loading…
Reference in New Issue