[FIX] mrp: cancel remaining products to consume if no more products to produce
opw: 630222
This commit is contained in:
committed by
Josse Colpaert
parent
34c891a426
commit
7ecb78adfa
@@ -986,6 +986,11 @@ class mrp_production(osv.osv):
|
||||
stock_mov_obj.action_done(cr, uid, [extra_move_id], context=context)
|
||||
|
||||
self.message_post(cr, uid, production_id, body=_("%s produced") % self._description, context=context)
|
||||
|
||||
# Remove remaining products to consume if no more products to produce
|
||||
if not production.move_created_ids and production.move_lines:
|
||||
stock_mov_obj.action_cancel(cr, uid, [x.id for x in production.move_lines], context=context)
|
||||
|
||||
self.signal_workflow(cr, uid, [production_id], 'button_produce_done')
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user