diff --git a/product_harmonized_system/README.rst b/product_harmonized_system/README.rst index 2b224b2..bf78274 100644 --- a/product_harmonized_system/README.rst +++ b/product_harmonized_system/README.rst @@ -14,13 +14,13 @@ Product Harmonized System Codes :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fintrastat--extrastat-lightgray.png?logo=github - :target: https://github.com/OCA/intrastat-extrastat/tree/14.0/product_harmonized_system + :target: https://github.com/OCA/intrastat-extrastat/tree/15.0/product_harmonized_system :alt: OCA/intrastat-extrastat .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-product_harmonized_system + :target: https://translation.odoo-community.org/projects/intrastat-extrastat-15-0/intrastat-extrastat-15-0-product_harmonized_system :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/227/14.0 + :target: https://runbot.odoo-community.org/runbot/227/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -56,7 +56,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -101,6 +101,6 @@ Current `maintainers `__: |maintainer-alexis-via| |maintainer-luc-demeyer| -This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. +This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py index 29158ed..d33ac4d 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -1,6 +1,7 @@ # Copyright 2018-2020 brain-tec AG (http://www.braintec-group.com) # Copyright 2011-2020 Akretion (http://www.akretion.com) # Copyright 2009-2020 Noviat (http://www.noviat.com) +# Copyright 2022 Tecnativa - Víctor Martínez # @author Benjamin Henquet # @author Kumar Aberer # @author Alexis de Lattre @@ -9,7 +10,7 @@ { "name": "Product Harmonized System Codes", - "version": "14.0.2.3.0", + "version": "15.0.1.0.0", "category": "Reporting", "license": "AGPL-3", "summary": "Base module for Product Import/Export reports", diff --git a/product_harmonized_system/i18n/es.po b/product_harmonized_system/i18n/es.po index edb4875..2ad55fc 100644 --- a/product_harmonized_system/i18n/es.po +++ b/product_harmonized_system/i18n/es.po @@ -252,9 +252,3 @@ msgstr "Unidades de almacenamiento" #: model:ir.model.constraint,message:product_harmonized_system.constraint_hs_code_local_code_company_uniq msgid "This code already exists for this company !" msgstr "Este código ya existe para esta compañía !" - -#~ msgid " Product Categs" -#~ msgstr " Categs Producto" - -#~ msgid " Products" -#~ msgstr " Productos" diff --git a/product_harmonized_system/i18n/fr.po b/product_harmonized_system/i18n/fr.po index 44015c2..46d0da4 100644 --- a/product_harmonized_system/i18n/fr.po +++ b/product_harmonized_system/i18n/fr.po @@ -253,16 +253,3 @@ msgstr "Unités de stockage" #: model:ir.model.constraint,message:product_harmonized_system.constraint_hs_code_local_code_company_uniq msgid "This code already exists for this company !" msgstr "Ce code existe déjà pour cette société !" - -#~ msgid "" -#~ "Code used for the national Import/Export declaration. e.g. Intrastat for " -#~ "the European Union" -#~ msgstr "" -#~ "Code utilisé pour la déclaration nationale d'import/export, par exemple " -#~ "la DEB pour la France" - -#~ msgid "HS Code" -#~ msgstr "Code S.H." - -#~ msgid "HS Codes" -#~ msgstr "Codes S.H." diff --git a/product_harmonized_system/migrations/14.0.2.0.0/post-migration.py b/product_harmonized_system/migrations/14.0.2.0.0/post-migration.py deleted file mode 100644 index 2319cf2..0000000 --- a/product_harmonized_system/migrations/14.0.2.0.0/post-migration.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2021 Akretion France (http://www.akretion.com/) -# @author: Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import SUPERUSER_ID, api - - -def migrate(cr, version): - if not version: - return - - with api.Environment.manage(): - env = api.Environment(cr, SUPERUSER_ID, {}) - pc_field_id = env.ref( - "product_harmonized_system.field_product_category__hs_code_id" - ).id - cr.execute( - """ - UPDATE product_category pc - SET hs_code_id=SUBSTRING(ip.value_reference, 9, 99)::int - FROM ir_property ip - WHERE ip.res_id like 'product.category,%%' AND - SUBSTRING(ip.res_id, 18, 99)::int=pc.id AND - ip.name='hs_code_id' AND - ip.value_reference IS NOT null AND - ip.fields_id=%s - """, - (pc_field_id,), - ) - pt_field_id = env.ref( - "product_harmonized_system.field_product_template__hs_code_id" - ).id - cr.execute( - """ - UPDATE product_template pt - SET hs_code_id=SUBSTRING(ip.value_reference, 9, 99)::int - FROM ir_property ip - WHERE ip.res_id like 'product.template,%%' AND - SUBSTRING(ip.res_id, 18, 99)::int=pt.id AND - ip.name='hs_code_id' AND - ip.value_reference IS NOT null AND - ip.fields_id=%s - """, - (pt_field_id,), - ) diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index da8cf11..89c1000 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -4,6 +4,8 @@ # @author Luc de Meyer # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from textwrap import shorten + from odoo import api, fields, models @@ -81,7 +83,7 @@ class HSCode(models.Model): name = this.local_code if this.description: name += " " + this.description - name = len(name) > 55 and name[:55] + "..." or name + name = shorten(name, 55) res.append((this.id, name)) return res diff --git a/product_harmonized_system/models/product_category.py b/product_harmonized_system/models/product_category.py index 89d10a3..e9d9750 100644 --- a/product_harmonized_system/models/product_category.py +++ b/product_harmonized_system/models/product_category.py @@ -13,9 +13,6 @@ class ProductCategory(models.Model): hs_code_id = fields.Many2one( "hs.code", string="H.S. Code", - # company_dependent updated from True to False in 14.0.2.0.0 - # migration scripts provided - company_dependent=False, ondelete="restrict", help="Harmonised System Code. If this code is not " "set on the product itself, it will be read here, on the " diff --git a/product_harmonized_system/models/product_template.py b/product_harmonized_system/models/product_template.py index 902deea..7aa950d 100644 --- a/product_harmonized_system/models/product_template.py +++ b/product_harmonized_system/models/product_template.py @@ -13,9 +13,6 @@ class ProductTemplate(models.Model): hs_code_id = fields.Many2one( "hs.code", string="H.S. Code", - # company_dependent updated from True to False in 14.0.2.0.0 - # migration scripts provided - company_dependent=False, ondelete="restrict", help="Harmonised System Code. Nomenclature is " "available from the World Customs Organisation, see " diff --git a/product_harmonized_system/static/description/index.html b/product_harmonized_system/static/description/index.html index 53a2502..52390f9 100644 --- a/product_harmonized_system/static/description/index.html +++ b/product_harmonized_system/static/description/index.html @@ -3,7 +3,7 @@ - + Product Harmonized System Codes