From e54d0aaa0b894f214e44fbc2d593512eb23077bd Mon Sep 17 00:00:00 2001 From: Francois Poizat Date: Tue, 6 Feb 2024 18:16:36 +0100 Subject: [PATCH] ADD change the way context is computed for the wizard --- mrp_bom_configurable/models/input_config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mrp_bom_configurable/models/input_config.py b/mrp_bom_configurable/models/input_config.py index f222232340..d3920713b7 100644 --- a/mrp_bom_configurable/models/input_config.py +++ b/mrp_bom_configurable/models/input_config.py @@ -1,3 +1,5 @@ +import json + from odoo import api, fields, models @@ -48,10 +50,15 @@ def create_boms_from_config(self): for line in rec.line_ids: line.create_bom_from_line() + def _get_wizard_context(self): + return { + "active_id": self.id, + } + def open_input_line_wizard(self): self.ensure_one() view = self.env.ref("mrp_bom_configurable.input_line_form_wizard_action") - view.context = f"{{'active_id': {self.id} }}" + view.context = json.dumps(self._get_wizard_context()) return view.read()[0] def show_lines(self):