Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | <a href='https://github.com/victoralmau'><img src='https://github.com/victoralmau.png' width='32' height='32' style='border-radius:50%;' alt='victoralmau'/></a> | Web Pwa Customize
Expand Down
2 changes: 1 addition & 1 deletion web_m2x_options_manager/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion web_m2x_options_manager/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions web_m2x_options_manager/demo/res_partner_demo_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
<!-- Many2one w/ options -->
<field
name="parent_id"
options="{'create': False, 'create_edit': False}"
options="{'create': false, 'create_edit': false}"
/>
<!-- Many2many w/ options -->
<field
name="category_id"
options="{'create': False, 'create_edit': False}"
options="{'create': false, 'create_edit': false}"
/>
</group>
</sheet>
Expand Down
2 changes: 1 addition & 1 deletion web_m2x_options_manager/models/m2x_create_edit_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion web_m2x_options_manager/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Web M2X Options Manager</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:496ff9c028368302f839913a2c4c825d59aa913df9048705ab11ce524d388144
!! source digest: sha256:16d18fbd77168c0ada84f3ae7987a1fc752238c88ee402749bb77bf71deefbda
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/17.0/web_m2x_options_manager"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_m2x_options_manager"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Allows managing the “Create…” and “Create and Edit…” options for
Expand Down
16 changes: 11 additions & 5 deletions web_m2x_options_manager/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading