diff --git a/product_harmonized_system_delivery/README.rst b/product_harmonized_system_delivery/README.rst new file mode 100644 index 000000000..2acc808b9 --- /dev/null +++ b/product_harmonized_system_delivery/README.rst @@ -0,0 +1,113 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +========================================== +Product Harmonized System Codes - Delivery +========================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:8e136e5cbfc9ea3539de39889b293551dd7d209fa12db17c5cc5b335735e98c9 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :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/19.0/product_harmonized_system_delivery + :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-19-0/intrastat-extrastat-19-0-product_harmonized_system_delivery + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/intrastat-extrastat&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +The OCA module *product_harmonized_system* adds a many2one field +*hs_code_id* on product templates that points to an *H.S. Code* object. +But the *stock_delivery* module from the official addons adds a char +field *hs_code* on product templates, which has the same purpose, but we +can't use it because we need structured data for H.S. codes. This module +hides the *hs_code* field added by the *stock_delivery* module, to avoid +confusion. + +Since Odoo v16, the *stock_delivery* module also adds a many2one field +*country_of_origin*, which is similar to the many2one field +*origin_country_id* of the OCA module *product_harmonized_system*. This +module also hides the *country_of_origin* field added by the +*stock_delivery* module. + +**Table of contents** + +.. contents:: + :local: + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Akretion + +Contributors +------------ + +- Alexis de Lattre +- Guewen Baconnier +- Nhan Tran + +Other credits +------------- + +The migration of this module from 18.0 to 19.0 was financially supported +by: + +- Camptocamp + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via +.. |maintainer-luc-demeyer| image:: https://github.com/luc-demeyer.png?size=40px + :target: https://github.com/luc-demeyer + :alt: luc-demeyer + +Current `maintainers `__: + +|maintainer-alexis-via| |maintainer-luc-demeyer| + +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_delivery/__init__.py b/product_harmonized_system_delivery/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/product_harmonized_system_delivery/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_harmonized_system_delivery/__manifest__.py b/product_harmonized_system_delivery/__manifest__.py new file mode 100644 index 000000000..fc226bba4 --- /dev/null +++ b/product_harmonized_system_delivery/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2018-2022 Akretion France (http://www.akretion.com) +# @author Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Harmonized System Codes - Delivery", + "version": "19.0.1.0.0", + "category": "Reporting", + "license": "AGPL-3", + "summary": "Hide native hs_code field provided by the delivery module", + "author": "Akretion, Odoo Community Association (OCA)", + "maintainers": ["alexis-via", "luc-demeyer"], + "website": "https://github.com/OCA/intrastat-extrastat", + "depends": ["stock_delivery", "product_harmonized_system"], + "data": ["views/product_template.xml"], + "installable": True, + "auto_install": True, +} diff --git a/product_harmonized_system_delivery/i18n/es.po b/product_harmonized_system_delivery/i18n/es.po new file mode 100644 index 000000000..2f09cc650 --- /dev/null +++ b/product_harmonized_system_delivery/i18n/es.po @@ -0,0 +1,61 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-04-17 17:33+0000\n" +"PO-Revision-Date: 2023-08-04 13:10+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: LANGUAGE \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__hs_code +msgid "HS Code" +msgstr "Código HS" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "Origin of Goods" +msgstr "Origen de las mercancías" + +#. module: product_harmonized_system_delivery +#: model:ir.model,name:product_harmonized_system_delivery.model_product_template +msgid "Product" +msgstr "Producto" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "" +"Rules of origin determine where goods originate, i.e. not where they have " +"been shipped from, but where they have been produced or manufactured.\n" +"As such, the ‘origin’ is the 'economic nationality' of goods traded in " +"commerce." +msgstr "" +"Las normas de origen determinan de dónde proceden los bienes, es decir, no " +"de dónde se han enviado, sino dónde se han producido o fabricado.\n" +"Como tal, el \"origen\" es la \"nacionalidad económica\" de los bienes " +"objeto de comercio." + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__hs_code +msgid "Standardized code for international shipping and goods declaration." +msgstr "" + +#~ msgid "" +#~ "Standardized code for international shipping and goods declaration. At " +#~ "the moment, only used for the FedEx shipping provider." +#~ msgstr "" +#~ "Código estandarizado para envío internacional y declaración de " +#~ "mercancías. De momento , sólo se usa para el proveedor FedEx." + +#~ msgid "Product Template" +#~ msgstr "Plantilla de Producto" diff --git a/product_harmonized_system_delivery/i18n/fr.po b/product_harmonized_system_delivery/i18n/fr.po new file mode 100644 index 000000000..a2429701e --- /dev/null +++ b/product_harmonized_system_delivery/i18n/fr.po @@ -0,0 +1,63 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_harmonized_system_delivery +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-06-07 19:08+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__hs_code +msgid "HS Code" +msgstr "Code SH" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "Origin of Goods" +msgstr "Origine des marchandises" + +#. module: product_harmonized_system_delivery +#: model:ir.model,name:product_harmonized_system_delivery.model_product_template +msgid "Product" +msgstr "Article" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "" +"Rules of origin determine where goods originate, i.e. not where they have " +"been shipped from, but where they have been produced or manufactured.\n" +"As such, the ‘origin’ is the 'economic nationality' of goods traded in " +"commerce." +msgstr "" +"Les règles d'origine déterminent l'origine des marchandises, c'est-à-dire " +"non pas l'endroit d'où elles ont été expédiées, mais l'endroit où elles ont " +"été produites ou fabriquées.\n" +"En tant que telle, l'\"origine\" est la \"nationalité économique\" des " +"marchandises échangées dans le commerce." + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__hs_code +msgid "Standardized code for international shipping and goods declaration." +msgstr "" + +#~ msgid "" +#~ "Standardized code for international shipping and goods declaration. At " +#~ "the moment, only used for the FedEx shipping provider." +#~ msgstr "" +#~ "Code standardisé pour les expéditions internationales et les déclarations " +#~ "de marchandises. Pour l'instant, il n'est utilisé que par le prestataire " +#~ "de services d'expédition FedEx." diff --git a/product_harmonized_system_delivery/i18n/hr.po b/product_harmonized_system_delivery/i18n/hr.po new file mode 100644 index 000000000..36f75eb8a --- /dev/null +++ b/product_harmonized_system_delivery/i18n/hr.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_harmonized_system_delivery +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-02-15 19:22+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__hs_code +msgid "HS Code" +msgstr "HS Šifra" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "Origin of Goods" +msgstr "Porijeklo robe" + +#. module: product_harmonized_system_delivery +#: model:ir.model,name:product_harmonized_system_delivery.model_product_template +msgid "Product" +msgstr "Proizvod" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "" +"Rules of origin determine where goods originate, i.e. not where they have " +"been shipped from, but where they have been produced or manufactured.\n" +"As such, the ‘origin’ is the 'economic nationality' of goods traded in " +"commerce." +msgstr "" +"Pravila porijekla određuju porijeklo robe. npr, ne od kuda je roba " +"dopremljena, nego gdje je roba proizvedena. \n" +"Ako takvo, 'Porijeklo' je 'Ekonomska nacionalnost' trgovačke robe." + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__hs_code +msgid "Standardized code for international shipping and goods declaration." +msgstr "" + +#~ msgid "" +#~ "Standardized code for international shipping and goods declaration. At " +#~ "the moment, only used for the FedEx shipping provider." +#~ msgstr "" +#~ "Standardizirana šifra za međunarodni transport i deklaraciju robe. " +#~ "Trenutno korišteno samo kod FedEX transporta." diff --git a/product_harmonized_system_delivery/i18n/it.po b/product_harmonized_system_delivery/i18n/it.po new file mode 100644 index 000000000..c2f337b45 --- /dev/null +++ b/product_harmonized_system_delivery/i18n/it.po @@ -0,0 +1,63 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_harmonized_system_delivery +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-05-29 16:26+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.10.4\n" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__hs_code +msgid "HS Code" +msgstr "Codice S.A." + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "Origin of Goods" +msgstr "Origine della merce" + +#. module: product_harmonized_system_delivery +#: model:ir.model,name:product_harmonized_system_delivery.model_product_template +msgid "Product" +msgstr "Prodotto" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "" +"Rules of origin determine where goods originate, i.e. not where they have " +"been shipped from, but where they have been produced or manufactured.\n" +"As such, the ‘origin’ is the 'economic nationality' of goods traded in " +"commerce." +msgstr "" +"Le regole dell'origine definiscono da dove si origina la merce, i.e. non da " +"dove è stata spedita ma dove è stata prodotta o lavorata.\n" +"In quanto tale, l’“origine” è la “nazionalità economica” dei beni scambiati " +"nel commercio." + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__hs_code +msgid "Standardized code for international shipping and goods declaration." +msgstr "" +"Codice standardizzato per la spedizione internazionale e dichiarazione della " +"merce." + +#~ msgid "" +#~ "Standardized code for international shipping and goods declaration. At " +#~ "the moment, only used for the FedEx shipping provider." +#~ msgstr "" +#~ "Codice standardizzato per la spedizione internazionale e la dichiarazione " +#~ "di beni. Al momento, utilizzato solamente per il corriere FedEx." diff --git a/product_harmonized_system_delivery/i18n/product_harmonized_system_delivery.pot b/product_harmonized_system_delivery/i18n/product_harmonized_system_delivery.pot new file mode 100644 index 000000000..f0f0c266a --- /dev/null +++ b/product_harmonized_system_delivery/i18n/product_harmonized_system_delivery.pot @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_harmonized_system_delivery +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__hs_code +msgid "HS Code" +msgstr "" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,field_description:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "Origin of Goods" +msgstr "" + +#. module: product_harmonized_system_delivery +#: model:ir.model,name:product_harmonized_system_delivery.model_product_template +msgid "Product" +msgstr "" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__country_of_origin +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__country_of_origin +msgid "" +"Rules of origin determine where goods originate, i.e. not where they have been shipped from, but where they have been produced or manufactured.\n" +"As such, the ‘origin’ is the 'economic nationality' of goods traded in commerce." +msgstr "" + +#. module: product_harmonized_system_delivery +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__hs_code +#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__hs_code +msgid "Standardized code for international shipping and goods declaration." +msgstr "" diff --git a/product_harmonized_system_delivery/models/__init__.py b/product_harmonized_system_delivery/models/__init__.py new file mode 100644 index 000000000..e8fa8f6bf --- /dev/null +++ b/product_harmonized_system_delivery/models/__init__.py @@ -0,0 +1 @@ +from . import product_template diff --git a/product_harmonized_system_delivery/models/product_template.py b/product_harmonized_system_delivery/models/product_template.py new file mode 100644 index 000000000..63a9320ce --- /dev/null +++ b/product_harmonized_system_delivery/models/product_template.py @@ -0,0 +1,12 @@ +# Copyright 2017-2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + # IMPORTANT: Overwrites two Odoo standard fields + hs_code = fields.Char(related="hs_code_id.hs_code", store=True) + country_of_origin = fields.Many2one(related="origin_country_id", store=True) diff --git a/product_harmonized_system_delivery/pyproject.toml b/product_harmonized_system_delivery/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/product_harmonized_system_delivery/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_harmonized_system_delivery/readme/CONTRIBUTORS.md b/product_harmonized_system_delivery/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..081944bcd --- /dev/null +++ b/product_harmonized_system_delivery/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Alexis de Lattre \<\> +- Guewen Baconnier \<\> +- Nhan Tran \<\> diff --git a/product_harmonized_system_delivery/readme/CREDITS.md b/product_harmonized_system_delivery/readme/CREDITS.md new file mode 100644 index 000000000..afd93acd0 --- /dev/null +++ b/product_harmonized_system_delivery/readme/CREDITS.md @@ -0,0 +1,3 @@ +The migration of this module from 18.0 to 19.0 was financially supported by: + +- Camptocamp \ No newline at end of file diff --git a/product_harmonized_system_delivery/readme/DESCRIPTION.md b/product_harmonized_system_delivery/readme/DESCRIPTION.md new file mode 100644 index 000000000..6f536d970 --- /dev/null +++ b/product_harmonized_system_delivery/readme/DESCRIPTION.md @@ -0,0 +1,12 @@ +The OCA module *product_harmonized_system* adds a many2one field +*hs_code_id* on product templates that points to an *H.S. Code* object. +But the *stock_delivery* module from the official addons adds a char field +*hs_code* on product templates, which has the same purpose, but we can't +use it because we need structured data for H.S. codes. This module hides +the *hs_code* field added by the *stock_delivery* module, to avoid confusion. + +Since Odoo v16, the *stock_delivery* module also adds a many2one field +*country_of_origin*, which is similar to the many2one field +*origin_country_id* of the OCA module *product_harmonized_system*. This +module also hides the *country_of_origin* field added by the *stock_delivery* +module. diff --git a/product_harmonized_system_delivery/static/description/icon.png b/product_harmonized_system_delivery/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/product_harmonized_system_delivery/static/description/icon.png differ diff --git a/product_harmonized_system_delivery/static/description/index.html b/product_harmonized_system_delivery/static/description/index.html new file mode 100644 index 000000000..afe108d8c --- /dev/null +++ b/product_harmonized_system_delivery/static/description/index.html @@ -0,0 +1,453 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Product Harmonized System Codes - Delivery

+ +

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

+

The OCA module product_harmonized_system adds a many2one field +hs_code_id on product templates that points to an H.S. Code object. +But the stock_delivery module from the official addons adds a char +field hs_code on product templates, which has the same purpose, but we +can’t use it because we need structured data for H.S. codes. This module +hides the hs_code field added by the stock_delivery module, to avoid +confusion.

+

Since Odoo v16, the stock_delivery module also adds a many2one field +country_of_origin, which is similar to the many2one field +origin_country_id of the OCA module product_harmonized_system. This +module also hides the country_of_origin field added by the +stock_delivery module.

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 18.0 to 19.0 was financially supported +by:

+
    +
  • Camptocamp
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainers:

+

alexis-via luc-demeyer

+

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_delivery/tests/__init__.py b/product_harmonized_system_delivery/tests/__init__.py new file mode 100644 index 000000000..19875bc09 --- /dev/null +++ b/product_harmonized_system_delivery/tests/__init__.py @@ -0,0 +1 @@ +from . import test_product_template_fields diff --git a/product_harmonized_system_delivery/tests/test_product_template_fields.py b/product_harmonized_system_delivery/tests/test_product_template_fields.py new file mode 100644 index 000000000..f0c9b27fd --- /dev/null +++ b/product_harmonized_system_delivery/tests/test_product_template_fields.py @@ -0,0 +1,36 @@ +from odoo.addons.base.tests.common import BaseCommon + + +class TestProductTemplateFields(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.country = cls.env.ref("base.us") + cls.HS1 = cls.env["hs.code"].create( + { + "local_code": "12345678", + "description": "Test Description", + } + ) + cls.product_tmpl = cls.env["product.template"].create( + { + "name": "Test Product Template", + "hs_code_id": cls.HS1.id, + "origin_country_id": cls.country.id, + } + ) + + cls.Product = cls.product_tmpl.product_variant_id + + def test_product_template_field_values(self): + """Verifies that custom fields overwrite Odoo fields""" + self.assertEqual( + self.product_tmpl.hs_code, + self.HS1.hs_code, + "The HS code did not overwrite the original value as expected.", + ) + self.assertEqual( + self.product_tmpl.country_of_origin, + self.country, + "The country of origin did not overwrite the original value as expected.", + ) diff --git a/product_harmonized_system_delivery/views/product_template.xml b/product_harmonized_system_delivery/views/product_template.xml new file mode 100644 index 000000000..b77c01c94 --- /dev/null +++ b/product_harmonized_system_delivery/views/product_template.xml @@ -0,0 +1,25 @@ + + + + + + hide_native_hs_code_field.product.template.form + product.template + + + + 1 + + + 1 + + + 1 + + + +