From 4595ccb34c814c8f1a042c7898d81c2f74f291e8 Mon Sep 17 00:00:00 2001 From: Andreu Orensanz Date: Mon, 11 Mar 2024 16:20:52 +0100 Subject: [PATCH] [MIG] product_harmonized_system: Migration to 17.0 --- product_harmonized_system/README.rst | 2 +- product_harmonized_system/__manifest__.py | 2 +- .../i18n/product_harmonized_system.pot | 8 ++------ product_harmonized_system/models/hs_code.py | 18 ++++++++---------- .../static/description/index.html | 3 +-- product_harmonized_system/views/hs_code.xml | 4 ++-- .../views/product_category.xml | 2 +- .../views/product_template.xml | 17 ++++++++++------- 8 files changed, 26 insertions(+), 30 deletions(-) diff --git a/product_harmonized_system/README.rst b/product_harmonized_system/README.rst index 586b40f..a885fdc 100644 --- a/product_harmonized_system/README.rst +++ b/product_harmonized_system/README.rst @@ -7,7 +7,7 @@ Product Harmonized System Codes !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:afd00899a20aac3c96a9b21fbcfc0c4a66f1617290ff92124a6b6987e5d9c975 + !! source digest: sha256:0cd16bb6b2c05a94c0dda271e92e0ceb3bd726d25244ee9d5eac2cb562c0d99e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py index 32033a3..443c552 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -10,7 +10,7 @@ { "name": "Product Harmonized System Codes", - "version": "16.0.1.1.0", + "version": "17.0.1.0.0", "category": "Reporting", "license": "AGPL-3", "summary": "Base module for Product Import/Export reports", diff --git a/product_harmonized_system/i18n/product_harmonized_system.pot b/product_harmonized_system/i18n/product_harmonized_system.pot index a881d84..84d5a1d 100644 --- a/product_harmonized_system/i18n/product_harmonized_system.pot +++ b/product_harmonized_system/i18n/product_harmonized_system.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 16.0\n" +"Project-Id-Version: Odoo Server 17.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -55,6 +55,7 @@ msgstr "" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_product_product__origin_country_id #: model:ir.model.fields,field_description:product_harmonized_system.field_product_template__origin_country_id +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.product_template_search_view msgid "Country of Origin" msgstr "" @@ -132,11 +133,6 @@ msgstr "" msgid "Import/Export Properties" msgstr "" -#. module: product_harmonized_system -#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code____last_update -msgid "Last Modified on" -msgstr "" - #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__write_uid msgid "Last Updated by" diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index 2bb3de4..c7b1221 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -65,32 +65,30 @@ class HSCode(models.Model): @api.depends("product_categ_ids") def _compute_product_categ_count(self): - rg_res = self.env["product.category"].read_group( - [("hs_code_id", "in", self.ids)], ["hs_code_id"], ["hs_code_id"] + rg_res = self.env["product.category"]._read_group( + [("hs_code_id", "in", self.ids)], ["hs_code_id"], ["id:count"] ) - mapped_data = {x["hs_code_id"][0]: x["hs_code_id_count"] for x in rg_res} + mapped_data = {rec.id: count for (rec, count) in rg_res} for code in self: code.product_categ_count = mapped_data.get(code.id, 0) @api.depends("product_tmpl_ids") def _compute_product_tmpl_count(self): - rg_res = self.env["product.template"].read_group( - [("hs_code_id", "in", self.ids)], ["hs_code_id"], ["hs_code_id"] + rg_res = self.env["product.template"]._read_group( + [("hs_code_id", "in", self.ids)], ["hs_code_id"], ["id:count"] ) - mapped_data = {x["hs_code_id"][0]: x["hs_code_id_count"] for x in rg_res} + mapped_data = {rec.id: count for (rec, count) in rg_res} for code in self: code.product_tmpl_count = mapped_data.get(code.id, 0) @api.depends("local_code", "description") - def name_get(self): - res = [] + def _compute_display_name(self): for this in self: name = this.local_code if this.description: name += " " + this.description name = shorten(name, 55) - res.append((this.id, name)) - return res + this.display_name = name _sql_constraints = [ ( diff --git a/product_harmonized_system/static/description/index.html b/product_harmonized_system/static/description/index.html index f65f7a6..4107434 100644 --- a/product_harmonized_system/static/description/index.html +++ b/product_harmonized_system/static/description/index.html @@ -1,4 +1,3 @@ - @@ -367,7 +366,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:afd00899a20aac3c96a9b21fbcfc0c4a66f1617290ff92124a6b6987e5d9c975 +!! source digest: sha256:0cd16bb6b2c05a94c0dda271e92e0ceb3bd726d25244ee9d5eac2cb562c0d99e !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

This module contains the objects for Harmonised System Codes (H.S. diff --git a/product_harmonized_system/views/hs_code.xml b/product_harmonized_system/views/hs_code.xml index 21f2ccb..9080a58 100644 --- a/product_harmonized_system/views/hs_code.xml +++ b/product_harmonized_system/views/hs_code.xml @@ -1,6 +1,6 @@ @@ -65,7 +65,7 @@ name="web_ribbon" title="Archived" bg_color="bg-danger" - attrs="{'invisible': [('active', '=', True)]}" + invisible="active" />