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/i18n/product_harmonized_system.pot b/product_harmonized_system/i18n/product_harmonized_system.pot
index 43ddf64..5ed0c2a 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 14.0\n"
+"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -94,9 +94,6 @@ msgstr ""
#. module: product_harmonized_system
#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__display_name
-#: model:ir.model.fields,field_description:product_harmonized_system.field_product_category__display_name
-#: model:ir.model.fields,field_description:product_harmonized_system.field_product_product__display_name
-#: model:ir.model.fields,field_description:product_harmonized_system.field_product_template__display_name
msgid "Display Name"
msgstr ""
@@ -106,14 +103,12 @@ msgstr ""
#: model:ir.model.fields,field_description:product_harmonized_system.field_product_category__hs_code_id
#: model:ir.model.fields,field_description:product_harmonized_system.field_product_product__hs_code_id
#: model:ir.model.fields,field_description:product_harmonized_system.field_product_template__hs_code_id
-#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form
#: model_terms:ir.ui.view,arch_db:product_harmonized_system.product_template_search_view
msgid "H.S. Code"
msgstr ""
#. module: product_harmonized_system
#: model:ir.actions.act_window,name:product_harmonized_system.hs_code_action
-#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_tree
msgid "H.S. Codes"
msgstr ""
@@ -142,9 +137,6 @@ msgstr ""
#. module: product_harmonized_system
#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__id
-#: model:ir.model.fields,field_description:product_harmonized_system.field_product_category__id
-#: model:ir.model.fields,field_description:product_harmonized_system.field_product_product__id
-#: model:ir.model.fields,field_description:product_harmonized_system.field_product_template__id
msgid "ID"
msgstr ""
@@ -155,9 +147,6 @@ msgstr ""
#. module: product_harmonized_system
#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code____last_update
-#: model:ir.model.fields,field_description:product_harmonized_system.field_product_category____last_update
-#: model:ir.model.fields,field_description:product_harmonized_system.field_product_product____last_update
-#: model:ir.model.fields,field_description:product_harmonized_system.field_product_template____last_update
msgid "Last Modified on"
msgstr ""
@@ -218,11 +207,6 @@ msgstr ""
msgid "Products"
msgstr ""
-#. module: product_harmonized_system
-#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_search
-msgid "Search H.S. Codes"
-msgstr ""
-
#. module: product_harmonized_system
#: model:ir.model.fields,help:product_harmonized_system.field_hs_code__description
msgid "Short text description of the H.S. category"
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..977ef0b 100644
--- a/product_harmonized_system/static/description/index.html
+++ b/product_harmonized_system/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module contains the objects for Harmonised System Codes (H.S. codes). The full nomenclature is available from the World Customs Organisation <http://www.wcoomd.org/>. These codes are usually required on the Proforma invoices that are attached to the packages that are shipped abroad.
This module also handles the local/national extensions to the H.S. codes. The import of the full nomenclature is not provided by this module; it should be provided by localization modules.
You will also be able to configure the country of origin of a product, which is often required on the proforma invoice for the customs.
@@ -400,7 +400,7 @@ ul.auto-toc {
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.
diff --git a/product_harmonized_system/views/hs_code.xml b/product_harmonized_system/views/hs_code.xml
index 564528d..9b93a30 100644
--- a/product_harmonized_system/views/hs_code.xml
+++ b/product_harmonized_system/views/hs_code.xml
@@ -1,6 +1,6 @@
@@ -10,7 +10,7 @@
hs.code.search
hs.code
-
+
hs.code.tree
hs.code
-
+
@@ -54,7 +54,7 @@
hs.code.form
hs.code
-