From 8259e3f73eee6b716b80238ac3d4e65bcbfeb06b Mon Sep 17 00:00:00 2001 From: Arnold Moyaux Date: Mon, 16 Aug 2021 08:46:55 +0000 Subject: [PATCH] [FIX] mrp: trigger scheduler in manufacturing multi steps Usecase to reproduce: - Enable multi steps manufacturing (pbm at least) - Set a RR 0 0 on a component - Confirm the MO -> The scheduler is not run for the components It happens because only the moves raw are confirm and not the pickings from the procurement group (like in SO) Part-of: odoo/odoo#75144 --- addons/mrp/models/mrp_production.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 140b8950a54..2ea9f11a437 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -1151,6 +1151,8 @@ class MrpProduction(models.Model): production.workorder_ids._action_confirm() # run scheduler for moves forecasted to not have enough in stock self.move_raw_ids._trigger_scheduler() + self.picking_ids.filtered( + lambda p: p.state not in ['cancel', 'done']).action_confirm() self.state = 'confirmed' return True