[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.
This commit is contained in:
kevin wang 2014-10-17 16:16:28 +02:00 committed by Martin Trigaux
parent a6343387d7
commit ef4d8b2df0
1 changed files with 2 additions and 2 deletions

View File

@ -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: