diff --git a/README.md b/README.md index 8ea6beb1c97b..d2d1c08e8d0f 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ addon | version | maintainers | summary [web_group_expand](web_group_expand/) | 17.0.1.0.0 | | Group Expand Buttons [web_ir_actions_act_multi](web_ir_actions_act_multi/) | 17.0.1.0.0 | | Enables triggering of more than one action on ActionManager [web_m2x_options](web_m2x_options/) | 17.0.1.0.7 | | web_m2x_options -[web_m2x_options_manager](web_m2x_options_manager/) | 17.0.1.0.0 | | Adds an interface to manage the "Create" and "Create and Edit" options for specific models and fields. +[web_m2x_options_manager](web_m2x_options_manager/) | 17.0.1.0.1 | | Adds an interface to manage the "Create" and "Create and Edit" options for specific models and fields. [web_no_bubble](web_no_bubble/) | 17.0.1.0.0 | | Remove the bubbles from the web interface [web_notify](web_notify/) | 17.0.1.1.0 | | Send notification messages to user [web_pwa_customize](web_pwa_customize/) | 17.0.1.0.0 | victoralmau | Web Pwa Customize diff --git a/web_m2x_options_manager/README.rst b/web_m2x_options_manager/README.rst index 368f4102c77f..8b01da1a6881 100644 --- a/web_m2x_options_manager/README.rst +++ b/web_m2x_options_manager/README.rst @@ -11,7 +11,7 @@ Web M2X Options Manager !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:496ff9c028368302f839913a2c4c825d59aa913df9048705ab11ce524d388144 + !! source digest: sha256:16d18fbd77168c0ada84f3ae7987a1fc752238c88ee402749bb77bf71deefbda !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/web_m2x_options_manager/__manifest__.py b/web_m2x_options_manager/__manifest__.py index 05c468697de2..783f458e383f 100644 --- a/web_m2x_options_manager/__manifest__.py +++ b/web_m2x_options_manager/__manifest__.py @@ -6,7 +6,7 @@ "summary": 'Adds an interface to manage the "Create" and' ' "Create and Edit" options for specific models and' " fields.", - "version": "17.0.1.0.0", + "version": "17.0.1.0.1", "author": "Camptocamp, Odoo Community Association (OCA)", "license": "AGPL-3", "category": "Web", diff --git a/web_m2x_options_manager/demo/res_partner_demo_view.xml b/web_m2x_options_manager/demo/res_partner_demo_view.xml index f68ec09cc125..960cf3c2a58d 100644 --- a/web_m2x_options_manager/demo/res_partner_demo_view.xml +++ b/web_m2x_options_manager/demo/res_partner_demo_view.xml @@ -14,12 +14,12 @@ diff --git a/web_m2x_options_manager/models/m2x_create_edit_option.py b/web_m2x_options_manager/models/m2x_create_edit_option.py index 9acb5cd45bf2..f1fecf8b901a 100644 --- a/web_m2x_options_manager/models/m2x_create_edit_option.py +++ b/web_m2x_options_manager/models/m2x_create_edit_option.py @@ -181,7 +181,7 @@ def _get_node_options_eval_context(self): """ self.ensure_one() eval_ctx = dict(self.env.context or []) - eval_ctx.update({"context": dict(eval_ctx)}) + eval_ctx.update({"context": dict(eval_ctx), "true": True, "false": False}) return eval_ctx def _read_own_options(self): diff --git a/web_m2x_options_manager/static/description/index.html b/web_m2x_options_manager/static/description/index.html index 947360e46994..cde19bb99bbd 100644 --- a/web_m2x_options_manager/static/description/index.html +++ b/web_m2x_options_manager/static/description/index.html @@ -372,7 +372,7 @@

Web M2X Options Manager

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:496ff9c028368302f839913a2c4c825d59aa913df9048705ab11ce524d388144 +!! source digest: sha256:16d18fbd77168c0ada84f3ae7987a1fc752238c88ee402749bb77bf71deefbda !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/web Translate me on Weblate Try me on Runboat

Allows managing the “Create…” and “Create and Edit…” options for diff --git a/web_m2x_options_manager/tests/common.py b/web_m2x_options_manager/tests/common.py index a0ff5c43d839..17b7318d4e4c 100644 --- a/web_m2x_options_manager/tests/common.py +++ b/web_m2x_options_manager/tests/common.py @@ -22,13 +22,19 @@ def _get_field(cls, model_name, field_name): def _get_model(cls, model_name): return cls.env["ir.model"]._get(model_name) - @staticmethod - def _eval_node_options(node): - opt = node.attrib.get("options") - if opt: - return safe_eval(opt, nocopy=True) + @classmethod + def _eval_node_options(cls, node): + opt = node.attrib.get("options") or {} + if isinstance(opt, str): + return safe_eval(opt, cls._get_node_options_eval_context(), nocopy=True) return {} + @classmethod + def _get_node_options_eval_context(cls): + eval_ctx = dict(cls.env.context or []) + eval_ctx.update({"context": dict(eval_ctx), "true": True, "false": False}) + return eval_ctx + @classmethod def _get_test_view(cls): return cls.env.ref("web_m2x_options_manager.res_partner_demo_form_view")