diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index fabeeca0fe3..3d933fc0dbf 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -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