From 2c91ad3ae86f54b79524f2673ef3ffc9fcd0c5d2 Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Thu, 1 Sep 2022 15:24:57 +0000 Subject: [PATCH] [FIX] mrp: remove onchange in import hack Since d7716f071d5da, the onchanges to create the stock moves in mrp production have been replaced by computes. There was a hack in the create() method to trigger the onchanges in case of import. As those onchanges do not exist anymore, this hack needs to be remove too. The compute methods are called naturally in imports. closes odoo/odoo#99434 Signed-off-by: Arnold Moyaux (arm) --- addons/mrp/models/mrp_production.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 14484e5eced..1e2ad102835 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -820,13 +820,7 @@ class MrpProduction(models.Model): if not vals.get('procurement_group_id'): procurement_group_vals = self._prepare_procurement_group_vals(vals) vals['procurement_group_id'] = self.env["procurement.group"].create(procurement_group_vals).id - productions = super().create(vals_list) - for production in productions: - # Trigger move_raw creation when importing a file - if 'import_file' in self.env.context: - production._onchange_move_raw() - production._onchange_move_finished() - return productions + return super().create(vals_list) def unlink(self): self.action_cancel()