From ccbab1a1eacbb41ff97c1e847e6cba8bfa6fa833 Mon Sep 17 00:00:00 2001 From: Swapnesh Shah Date: Tue, 20 Apr 2021 16:27:58 +0000 Subject: [PATCH] [FIX] mrp: remove workorder_ids on removing bom_id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Method `_onchange_workorder_ids` will create workorder_ids for the the selected bom but it was not re-setting it on removing BoM. It was causing issue on `_action_confirm` as Bom for the selected WO will not be found. closes odoo/odoo#69662 Fixes: #68261 X-original-commit: 13832912daafad7c472d7414eaacede9e302e787 Signed-off-by: Rémy Voet --- 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 54873be048e..eed08659bf6 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -671,6 +671,8 @@ class MrpProduction(models.Model): def _onchange_workorder_ids(self): if self.bom_id: self._create_workorder() + else: + self.workorder_ids = False def write(self, vals): if 'workorder_ids' in self: