From 962854e974d398a4f42ea6f12eb96bbcc6d68d0b Mon Sep 17 00:00:00 2001 From: Arturo Arribas Date: Tue, 7 May 2024 12:12:47 +0200 Subject: [PATCH] [MIG] mrp_tag: Migration to 17.0 --- mrp_tag/README.rst | 1 + mrp_tag/__manifest__.py | 2 +- mrp_tag/models/mrp_tag.py | 19 ++++++++----------- mrp_tag/readme/CONTRIBUTORS.md | 1 + mrp_tag/static/description/index.html | 1 + mrp_tag/views/mrp_production_view.xml | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mrp_tag/README.rst b/mrp_tag/README.rst index 40250b59fe..857b3ca488 100644 --- a/mrp_tag/README.rst +++ b/mrp_tag/README.rst @@ -62,6 +62,7 @@ Contributors ------------ - Jasmin Solanki +- Arturo Arribas Maintainers ----------- diff --git a/mrp_tag/__manifest__.py b/mrp_tag/__manifest__.py index b4500b9b5b..fe9a1550d3 100644 --- a/mrp_tag/__manifest__.py +++ b/mrp_tag/__manifest__.py @@ -5,7 +5,7 @@ { "name": "MRP Tags", "summary": "Allows to add multiple tags to Manufacturing Orders", - "version": "16.0.1.1.0", + "version": "17.0.1.0.0", "author": "ForgeFlow, Odoo Community Association (OCA)", "website": "https://github.com/OCA/manufacture", "category": "Purchases", diff --git a/mrp_tag/models/mrp_tag.py b/mrp_tag/models/mrp_tag.py index 4cfff01736..86159a4dc9 100644 --- a/mrp_tag/models/mrp_tag.py +++ b/mrp_tag/models/mrp_tag.py @@ -26,29 +26,26 @@ def _get_default_color(self): ("tag_name_uniq", "unique (name)", "Tag name already exists !"), ] - def name_get(self): - res = [] + @api.depends("name", "parent_id") + def _compute_display_name(self): for tag in self: names = [] current = tag - while current: + while current.name: names.append(current.name) current = current.parent_id - res.append((tag.id, " / ".join(reversed(names)))) - return res + tag.display_name = " / ".join(reversed(names)) @api.model - def _name_search( - self, name="", args=None, operator="ilike", limit=100, name_get_uid=None - ): + def _name_search(self, name, domain=None, operator="ilike", limit=None, order=None): if name: - args = [("name", operator, name.split(" / ")[-1])] + list(args or []) + domain = [("name", operator, name.split(" / ")[-1])] + list(domain or []) return super()._name_search( name=name, - args=args, + domain=domain, operator=operator, limit=limit, - name_get_uid=name_get_uid, + order=order, ) @api.constrains("parent_id") diff --git a/mrp_tag/readme/CONTRIBUTORS.md b/mrp_tag/readme/CONTRIBUTORS.md index 88b3ed521e..69368a34f0 100644 --- a/mrp_tag/readme/CONTRIBUTORS.md +++ b/mrp_tag/readme/CONTRIBUTORS.md @@ -1 +1,2 @@ - Jasmin Solanki \<\> +- Arturo Arribas \<\> diff --git a/mrp_tag/static/description/index.html b/mrp_tag/static/description/index.html index 7eeb80e4dd..96d855eef8 100644 --- a/mrp_tag/static/description/index.html +++ b/mrp_tag/static/description/index.html @@ -408,6 +408,7 @@

Authors

Contributors

diff --git a/mrp_tag/views/mrp_production_view.xml b/mrp_tag/views/mrp_production_view.xml index 34f53678d2..833419a66c 100644 --- a/mrp_tag/views/mrp_production_view.xml +++ b/mrp_tag/views/mrp_production_view.xml @@ -26,7 +26,7 @@ mrp.production - +