From 92744b789580b0a68eef6771b7923946f05cf2f8 Mon Sep 17 00:00:00 2001 From: Nicolas Pierre Date: Wed, 13 Jul 2022 12:32:09 +0000 Subject: [PATCH] [FIX] mrp: allow creation of QC for MO backorders Since https://github.com/odoo/odoo/pull/77254, Quality Checks are not created on the backorders of a MO because the moves of the backorders are not confirmed anymore. We therefore create the QC of the backorders at the confirmation of the workorders. closes odoo/odoo#97296 Task-id: 2901900 Enterprise-pr: https://github.com/odoo/enterprise/pull/29476 X-original-commit: 702dd5c902c40972e4362d28c8f10a1eb911a241 Related: odoo/enterprise#30033 Signed-off-by: Tiffany Chang --- addons/mrp/models/mrp_production.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 040c7f53086..702077fd263 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -1741,10 +1741,13 @@ class MrpProduction(models.Model): else: workorders_to_cancel += workorder workorders_to_cancel.action_cancel() - backorders.workorder_ids._action_confirm() + backorders._action_confirm_mo_backorders() return self.env['mrp.production'].browse(production_ids) + def _action_confirm_mo_backorders(self): + self.workorder_ids._action_confirm() + def button_mark_done(self): self._button_mark_done_sanity_checks()