diff --git a/mrp_bom_configurable/models/mrp_bom_line.py b/mrp_bom_configurable/models/mrp_bom_line.py index 8ef750a1886..a19de8b0dac 100644 --- a/mrp_bom_configurable/models/mrp_bom_line.py +++ b/mrp_bom_configurable/models/mrp_bom_line.py @@ -1,6 +1,6 @@ import logging -from odoo import fields, models +from odoo import _, fields, models from odoo.tools.safe_eval import safe_eval logger = logging.getLogger(__name__) @@ -50,6 +50,18 @@ def execute(self, values): if not self.domain: return True else: - domain = safe_eval(self.domain) + # TODO need to work with only one '=' here + domain = safe_eval(self.domain.replace("=", "==")) return self.execute_domain(domain, values) + + def ui_update_domain(self): + self.ensure_one() + return { + "name": _(f"Domain for {self.product_id}"), + "type": "ir.actions.act_window", + "res_model": "mrp.bom.line", + "res_id": self.id, + "view_mode": "form", + "target": "current", + } diff --git a/mrp_bom_configurable/views/mrp_view.xml b/mrp_bom_configurable/views/mrp_view.xml index fbf35bac729..1384cd907e7 100644 --- a/mrp_bom_configurable/views/mrp_view.xml +++ b/mrp_bom_configurable/views/mrp_view.xml @@ -1,5 +1,6 @@ + mrp.bom @@ -8,10 +9,16 @@ - + +