[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 <tic@odoo.com>
This commit is contained in:
Nicolas Pierre
2022-08-02 13:06:36 +02:00
parent 18b4d919df
commit 92744b7895
+4 -1
View File
@@ -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()