From 888efc67ba3983e9ce6f17f9b3ba7aa35f069f03 Mon Sep 17 00:00:00 2001 From: Wodran Van de Sande Date: Wed, 5 Jun 2024 10:48:35 +0200 Subject: [PATCH] [MIG] web_m2x_options_manager: Migration to 17.0 --- web_m2x_options_manager/README.rst | 1 + web_m2x_options_manager/__manifest__.py | 2 +- web_m2x_options_manager/models/m2x_create_edit_option.py | 6 +++--- web_m2x_options_manager/readme/CONTRIBUTORS.md | 1 + web_m2x_options_manager/static/description/index.html | 1 + .../tests/test_m2x_create_edit_option.py | 4 ++-- web_m2x_options_manager/views/ir_model.xml | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/web_m2x_options_manager/README.rst b/web_m2x_options_manager/README.rst index 1f1e4d819..8aa308244 100644 --- a/web_m2x_options_manager/README.rst +++ b/web_m2x_options_manager/README.rst @@ -73,6 +73,7 @@ Contributors - Silvio Gregorini - Duong (Tran Quoc) +- Chau Le Maintainers ----------- diff --git a/web_m2x_options_manager/__manifest__.py b/web_m2x_options_manager/__manifest__.py index 8c3aae5d4..704d34411 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": "16.0.1.0.0", + "version": "17.0.1.0.0", "author": "Camptocamp, Odoo Community Association (OCA)", "license": "AGPL-3", "category": "Web", 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 2712b2627..4b55f3654 100644 --- a/web_m2x_options_manager/models/m2x_create_edit_option.py +++ b/web_m2x_options_manager/models/m2x_create_edit_option.py @@ -93,17 +93,17 @@ class M2xCreateEditOption(models.Model): @api.model_create_multi def create(self, vals_list): # Clear cache to avoid misbehavior from cached :meth:`_get()` - type(self)._get.clear_cache(self.browse()) + self.env.registry.clear_all_caches() return super().create(vals_list) def write(self, vals): # Clear cache to avoid misbehavior from cached :meth:`_get()` - type(self)._get.clear_cache(self.browse()) + self.env.registry.clear_all_caches() return super().write(vals) def unlink(self): # Clear cache to avoid misbehavior from cached :meth:`_get()` - type(self)._get.clear_cache(self.browse()) + self.env.registry.clear_all_caches() return super().unlink() @api.depends("model_id") diff --git a/web_m2x_options_manager/readme/CONTRIBUTORS.md b/web_m2x_options_manager/readme/CONTRIBUTORS.md index e18540046..ee6fdeb91 100644 --- a/web_m2x_options_manager/readme/CONTRIBUTORS.md +++ b/web_m2x_options_manager/readme/CONTRIBUTORS.md @@ -1,3 +1,4 @@ - [Camptocamp](https://www.camptocamp.com): - Silvio Gregorini - Duong (Tran Quoc) \<\> +- Chau Le \<\> diff --git a/web_m2x_options_manager/static/description/index.html b/web_m2x_options_manager/static/description/index.html index 31730993b..309f1d149 100644 --- a/web_m2x_options_manager/static/description/index.html +++ b/web_m2x_options_manager/static/description/index.html @@ -417,6 +417,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • Duong (Tran Quoc) <duongtq@trobz.com>
  • +
  • Chau Le <chaulb@trobz.com>
  • diff --git a/web_m2x_options_manager/tests/test_m2x_create_edit_option.py b/web_m2x_options_manager/tests/test_m2x_create_edit_option.py index 3e789d3ef..c65783f2b 100644 --- a/web_m2x_options_manager/tests/test_m2x_create_edit_option.py +++ b/web_m2x_options_manager/tests/test_m2x_create_edit_option.py @@ -10,7 +10,7 @@ from odoo.tools.safe_eval import safe_eval class TestM2xCreateEditOption(TransactionCase): def setUp(self): - super(TestM2xCreateEditOption, self).setUp() + super().setUp() ref = self.env.ref # View to be used self.view = ref("web_m2x_options_manager.res_partner_demo_form_view") @@ -90,7 +90,7 @@ class TestM2xCreateEditOption(TransactionCase): title_node.attrib.get("can_create"), title_node.attrib.get("can_write"), ), - ("true", "true"), + ("True", "True"), ) categ_node = form_doc.xpath("//field[@name='category_id']")[0] self.assertEqual( diff --git a/web_m2x_options_manager/views/ir_model.xml b/web_m2x_options_manager/views/ir_model.xml index 9037b27a7..b30817f0e 100644 --- a/web_m2x_options_manager/views/ir_model.xml +++ b/web_m2x_options_manager/views/ir_model.xml @@ -18,7 +18,7 @@ context="{'default_model_name': model}" > - +