From db53aacd5a02713b83e91ab2ed0cb3967b49537b Mon Sep 17 00:00:00 2001 From: BenjaHe Date: Thu, 19 Dec 2019 09:18:09 +0100 Subject: [PATCH 01/35] [13.0] [MIG] product harmonized system (#80) * Large code re-engineering following the Akretion-Noviat code sprint on intrastat This code has been written both by Luc de Meyer and myself. * hs_code display_name fix * major update intrastat V3 modules * Add product_origin_country_id on declaration/computation lines Copy incoterms and destination country from SO to invoice when invoicing from SO We need weight even when supplementary units is used Small cleanups and enhancements * Add support for accessory costs Add default values for intrastat transaction on company Code cleanup * this week's ci errors * Update README.rst Rename variables * Port intrastat_base to v10 Set 2 other modules to uninstallable Update README.rst: switch to new intrastat project * Port product_harmonized_system to v10 * Fix warning on display_name Special thanks to Pedro and Holger for finding the solution for display_name Fix demo data * [MIG] product_harmonized_system: Migration to 11.0 * [FIX] product_harmonized_system: fix get_hs_code_recurively * [IMP] *: removed utf-8 headers, changed icon and site * company model test, country model test as in v8 * png logo instead of svg, removed Python 2 utf-8 headers * [UPD] Update product_harmonized_system.pot * Add new module product_harmonized_system_delivery (hide native hs_code field) Finalize port to v11 * [FIX+IMP] intrastat_*: Several things: * Add readonly on some fields when state of declaration is done * Division by zero in computation of accessory costs * Add FR translation * Fix strings * Minor code updates * [MIG] intrastat_product: Migration to 11.0 * Small fixes in intrastat_base * account_tax_template * [ADD] icon.png * [UPD] Update product_harmonized_system.pot * Prepare v12 branch * [MIG] Migrate all modules from v11 to v12 * flake8 * [UPD] Update product_harmonized_system.pot * Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-12.0/intrastat-extrastat-12.0-product_harmonized_system Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-12-0/intrastat-extrastat-12-0-product_harmonized_system/ * [FIX] product_harmized_system DESCRIPTION.rst * [UPD] README.rst * [UPD] README.rst * Added translation using Weblate (Spanish) * Translated using Weblate (Spanish) Currently translated at 50.0% (18 of 36 strings) Translation: intrastat-extrastat-12.0/intrastat-extrastat-12.0-product_harmonized_system Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-12-0/intrastat-extrastat-12-0-product_harmonized_system/es/ * [MIG] product_harmonized_system : Migration to 13.0 * [IMP] product_harmonized_system: black, isort [UPD] README.rst [UPD] Update product_harmonized_system.pot Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-13.0/intrastat-extrastat-13.0-product_harmonized_system Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-13-0/intrastat-extrastat-13-0-product_harmonized_system/ --- product_harmonized_system/README.rst | 95 ++++ product_harmonized_system/__init__.py | 1 + product_harmonized_system/__manifest__.py | 28 ++ .../demo/product_demo.xml | 75 +++ product_harmonized_system/i18n/es.po | 226 +++++++++ product_harmonized_system/i18n/fr.po | 240 ++++++++++ .../i18n/product_harmonized_system.pot | 215 +++++++++ product_harmonized_system/models/__init__.py | 3 + product_harmonized_system/models/hs_code.py | 103 +++++ .../models/product_category.py | 31 ++ .../models/product_template.py | 41 ++ .../readme/CONTRIBUTORS.rst | 3 + .../readme/DESCRIPTION.rst | 7 + product_harmonized_system/readme/INSTALL.rst | 1 + product_harmonized_system/readme/USAGE.rst | 3 + .../security/ir.model.access.csv | 3 + .../security/product_hs_security.xml | 10 + .../static/description/icon.png | Bin 0 -> 9455 bytes .../static/description/index.html | 437 ++++++++++++++++++ product_harmonized_system/views/hs_code.xml | 103 +++++ .../views/product_category.xml | 24 + .../views/product_template.xml | 23 + 22 files changed, 1672 insertions(+) create mode 100644 product_harmonized_system/README.rst create mode 100644 product_harmonized_system/__init__.py create mode 100644 product_harmonized_system/__manifest__.py create mode 100644 product_harmonized_system/demo/product_demo.xml create mode 100644 product_harmonized_system/i18n/es.po create mode 100644 product_harmonized_system/i18n/fr.po create mode 100644 product_harmonized_system/i18n/product_harmonized_system.pot create mode 100644 product_harmonized_system/models/__init__.py create mode 100644 product_harmonized_system/models/hs_code.py create mode 100644 product_harmonized_system/models/product_category.py create mode 100644 product_harmonized_system/models/product_template.py create mode 100644 product_harmonized_system/readme/CONTRIBUTORS.rst create mode 100644 product_harmonized_system/readme/DESCRIPTION.rst create mode 100644 product_harmonized_system/readme/INSTALL.rst create mode 100644 product_harmonized_system/readme/USAGE.rst create mode 100644 product_harmonized_system/security/ir.model.access.csv create mode 100644 product_harmonized_system/security/product_hs_security.xml create mode 100644 product_harmonized_system/static/description/icon.png create mode 100644 product_harmonized_system/static/description/index.html create mode 100644 product_harmonized_system/views/hs_code.xml create mode 100644 product_harmonized_system/views/product_category.xml create mode 100644 product_harmonized_system/views/product_template.xml diff --git a/product_harmonized_system/README.rst b/product_harmonized_system/README.rst new file mode 100644 index 000000000..eea323f45 --- /dev/null +++ b/product_harmonized_system/README.rst @@ -0,0 +1,95 @@ +=============================== +Product Harmonized System Codes +=============================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/licence-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/13.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-13-0/intrastat-extrastat-13-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/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module contains the objects for Harmonised System Codes (H.S. codes). The full nomenclature is available from the `World Customs Organisation `. These code are usually required on the Proforma invoices that are attached to the packages that are shipped abroad. + +This module also handle 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. + +This module should be usefull for all companies that export physical goods abroad. This module is also used by the Intrastat modules for the European Union, cf the *intrastat_product* module. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +This module is NOT compatible with the *account_intrastat* module from Odoo Enterprise. + +Usage +===== + +As this module only depends on the *product* module and that module doesn't provide any menu entry, this module lacks a menu entry for H.S. Codes. A menu entry for H.S. codes is provided by the module *product_harmonized_system_stock*. + +Once the H.S. codes are created, you will be able to set the H.S. code on an product (under the *Information* tab) or on a product category. On the product form, you will also be able to set the *Country of Origin* of a product (for example, if the product is *made in China*, select *China* as *Country of Origin*). + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* brain-tec AG +* Akretion +* Noviat + +Contributors +~~~~~~~~~~~~ + +* Alexis de Lattre, Akretion +* Luc De Meyer, Noviat +* Kumar Aberer, brain-tec AG + +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. + +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/__init__.py b/product_harmonized_system/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/product_harmonized_system/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py new file mode 100644 index 000000000..8aa90ed33 --- /dev/null +++ b/product_harmonized_system/__manifest__.py @@ -0,0 +1,28 @@ +# Copyright 2018 brain-tec AG (http://www.braintec-group.com) +# Copyright 2011-2016 Akretion (http://www.akretion.com) +# Copyright 2009-2019 Noviat (http://www.noviat.com) +# @author Benjamin Henquet +# @author Kumar Aberer +# @author Alexis de Lattre +# @author Luc de Meyer +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Harmonized System Codes", + "version": "13.0.1.0.0", + "category": "Reporting", + "license": "AGPL-3", + "summary": "Base module for Product Import/Export reports", + "author": "brain-tec AG, Akretion, Noviat, " "Odoo Community Association (OCA)", + "depends": ["product"], + "excludes": ["account_intrastat"], + "data": [ + "security/product_hs_security.xml", + "security/ir.model.access.csv", + "views/hs_code.xml", + "views/product_category.xml", + "views/product_template.xml", + ], + "demo": ["demo/product_demo.xml"], + "installable": True, +} diff --git a/product_harmonized_system/demo/product_demo.xml b/product_harmonized_system/demo/product_demo.xml new file mode 100644 index 000000000..423f67d33 --- /dev/null +++ b/product_harmonized_system/demo/product_demo.xml @@ -0,0 +1,75 @@ + + + + + + + + 84715000 + Automatic data-processing machines (computers) + + + + 84717050 + Storage units + + + + 85340090 + Printed circuits + + + + + + 8.7 + + + + + + 1.1 + + + + + + 8.2 + + + + + + 0.01 + + + + + + 0.67 + + + + + + 1.05 + + + + + + 0.3 + + + + + + 3.3 + + + + diff --git a/product_harmonized_system/i18n/es.po b/product_harmonized_system/i18n/es.po new file mode 100644 index 000000000..2f85e70b1 --- /dev/null +++ b/product_harmonized_system/i18n/es.po @@ -0,0 +1,226 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_harmonized_system +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-11-10 18:34+0000\n" +"Last-Translator: Galoperd \n" +"Language-Team: none\n" +"Language: es\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 3.8\n" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form +msgid " Product Categs" +msgstr " Categs Producto" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form +msgid " Products" +msgstr " Productos" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__active +msgid "Active" +msgstr "Activo" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_search +msgid "Archived" +msgstr "Archivado" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.84715000 +msgid "Automatic data-processing machines (computers)" +msgstr "Máquinas de procesado de datos automático (ordenadores)" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_hs_code__local_code +msgid "" +"Code used for the national Import/Export declaration. The national code " +"starts with the 6 digits of the H.S. and often has a few additional digits " +"to extend the H.S. code." +msgstr "" +"Código utilizado para la declaración Import/Export. El código nacional " +"empieza con 6 dígitos del H.S. y a menudo tiene un pocos dígitos adicionales " +"para extender el código H.S." + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__company_id +msgid "Company" +msgstr "Compañía" + +#. 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 +msgid "Country of Origin" +msgstr "País de Origen" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_country_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_country_id +msgid "Country of origin of the product i.e. product 'made in ____'." +msgstr "País de origen del producto p.e. producto ‘fabricado en_____’." + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_date +msgid "Created on" +msgstr "Creado en" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__description +msgid "Description" +msgstr "Descripción" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_hs_code +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__hs_code +#: 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 +msgid "H.S. Code" +msgstr "Código HS" + +#. 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 "Códigos HS" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_category__hs_code_id +msgid "" +"Harmonised System Code. If this code is not set on the product itself, it " +"will be read here, on the related product category." +msgstr "" +"Código del Sistema Armonizado HS. Si el código no está escrito en el " +"producto, se leerá aquí, en la categoría de producto relacionada." + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__hs_code_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__hs_code_id +msgid "" +"Harmonised System Code. Nomenclature is available from the World Customs " +"Organisation, see http://www.wcoomd.org/. You can leave this field empty and " +"configure the H.S. code on the product category." +msgstr "" +"Harmonised System Code. Nomenclatura disponible en World Customs " +"Organisation, ver http://www.wcoomd.org/. Puede dejar este campo vacío y " +"configurar el código H.S. en la categoría de producto.." + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_hs_code__hs_code +msgid "" +"Harmonized System code (6 digits). Full list is available from the World " +"Customs Organisation, see http://www.wcoomd.org" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__id +msgid "ID" +msgstr "" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.product_category_form_view +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" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__local_code +msgid "Local Code" +msgstr "" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.85340090 +msgid "Printed circuits" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_product +msgid "Product" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_count +msgid "Product Categ Count" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.actions.act_window,name:product_harmonized_system.product_categ_hs_code_action +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_ids +msgid "Product Categories" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_category +msgid "Product Category" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_count +msgid "Product Tmpl Count" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.actions.act_window,name:product_harmonized_system.product_template_hs_code_action +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_ids +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" +msgstr "" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.84717050 +msgid "Storage units" +msgstr "" + +#. module: product_harmonized_system +#: 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 !" diff --git a/product_harmonized_system/i18n/fr.po b/product_harmonized_system/i18n/fr.po new file mode 100644 index 000000000..b49d68fa8 --- /dev/null +++ b/product_harmonized_system/i18n/fr.po @@ -0,0 +1,240 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_harmonized_system +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-16 13:11+0000\n" +"PO-Revision-Date: 2015-07-16 13:11+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: \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 +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form +msgid " Product Categs" +msgstr "" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form +msgid " Products" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__active +msgid "Active" +msgstr "Actif" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_search +msgid "Archived" +msgstr "" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.84715000 +msgid "Automatic data-processing machines (computers)" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_hs_code__local_code +msgid "" +"Code used for the national Import/Export declaration. The national code " +"starts with the 6 digits of the H.S. and often has a few additional digits " +"to extend the H.S. code." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__company_id +msgid "Company" +msgstr "Société" + +#. 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 +msgid "Country of Origin" +msgstr "Pays d'origine" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_country_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_country_id +msgid "Country of origin of the product i.e. product 'made in ____'." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__description +msgid "Description" +msgstr "Description" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_hs_code +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__hs_code +#: 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 +msgid "H.S. Code" +msgstr "Code S.H." + +#. 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 +#, fuzzy +msgid "H.S. Codes" +msgstr "Code S.H." + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_category__hs_code_id +msgid "" +"Harmonised System Code. If this code is not set on the product itself, it " +"will be read here, on the related product category." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__hs_code_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__hs_code_id +msgid "" +"Harmonised System Code. Nomenclature is available from the World Customs " +"Organisation, see http://www.wcoomd.org/. You can leave this field empty and " +"configure the H.S. code on the product category." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_hs_code__hs_code +msgid "" +"Harmonized System code (6 digits). Full list is available from the World " +"Customs Organisation, see http://www.wcoomd.org" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__id +msgid "ID" +msgstr "ID" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.product_category_form_view +msgid "Import/Export Properties" +msgstr "Propriétés pour l'import/export" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code____last_update +#, fuzzy +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__write_uid +msgid "Last Updated by" +msgstr "Dernière modification par" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__write_date +msgid "Last Updated on" +msgstr "Dernière modification le" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__local_code +msgid "Local Code" +msgstr "Code local" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.85340090 +msgid "Printed circuits" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_product +#, fuzzy +msgid "Product" +msgstr "Catégorie d'articles" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_count +#, fuzzy +#| msgid "Product Category" +msgid "Product Categ Count" +msgstr "Catégorie d'articles" + +#. module: product_harmonized_system +#: model:ir.actions.act_window,name:product_harmonized_system.product_categ_hs_code_action +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_ids +#, fuzzy +msgid "Product Categories" +msgstr "Catégorie d'articles" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_category +msgid "Product Category" +msgstr "Catégorie d'articles" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_template +msgid "Product Template" +msgstr "Modèle d'article" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_count +#, fuzzy +#| msgid "Product Template" +msgid "Product Tmpl Count" +msgstr "Modèle d'article" + +#. module: product_harmonized_system +#: model:ir.actions.act_window,name:product_harmonized_system.product_template_hs_code_action +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_ids +msgid "Products" +msgstr "" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_search +#, fuzzy +msgid "Search H.S. Codes" +msgstr "Recherche dans les codes S.H." + +#. 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" +msgstr "Courte description de la catégorie H.S." + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.84717050 +msgid "Storage units" +msgstr "" + +#. module: product_harmonized_system +#: 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 new file mode 100644 index 000000000..2be2b53fa --- /dev/null +++ b/product_harmonized_system/i18n/product_harmonized_system.pot @@ -0,0 +1,215 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_harmonized_system +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.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 +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form +msgid " Product Categs" +msgstr "" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form +msgid " Products" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__active +msgid "Active" +msgstr "" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_search +msgid "Archived" +msgstr "" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.84715000 +msgid "Automatic data-processing machines (computers)" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_hs_code__local_code +msgid "" +"Code used for the national Import/Export declaration. The national code " +"starts with the 6 digits of the H.S. and often has a few additional digits " +"to extend the H.S. code." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__company_id +msgid "Company" +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 +msgid "Country of Origin" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_country_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_country_id +msgid "Country of origin of the product i.e. product 'made in ____'." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_uid +msgid "Created by" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_date +msgid "Created on" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__description +msgid "Description" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__display_name +msgid "Display Name" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_hs_code +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__hs_code +#: 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 +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 "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_category__hs_code_id +msgid "" +"Harmonised System Code. If this code is not set on the product itself, it " +"will be read here, on the related product category." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__hs_code_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__hs_code_id +msgid "" +"Harmonised System Code. Nomenclature is available from the World Customs " +"Organisation, see http://www.wcoomd.org/. You can leave this field empty and" +" configure the H.S. code on the product category." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_hs_code__hs_code +msgid "" +"Harmonized System code (6 digits). Full list is available from the World " +"Customs Organisation, see http://www.wcoomd.org" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__id +msgid "ID" +msgstr "" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.product_category_form_view +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" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__local_code +msgid "Local Code" +msgstr "" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.85340090 +msgid "Printed circuits" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_product +msgid "Product" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_count +msgid "Product Categ Count" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.actions.act_window,name:product_harmonized_system.product_categ_hs_code_action +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_ids +msgid "Product Categories" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_category +msgid "Product Category" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_count +msgid "Product Tmpl Count" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.actions.act_window,name:product_harmonized_system.product_template_hs_code_action +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_ids +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" +msgstr "" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.84717050 +msgid "Storage units" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.constraint,message:product_harmonized_system.constraint_hs_code_local_code_company_uniq +msgid "This code already exists for this company !" +msgstr "" diff --git a/product_harmonized_system/models/__init__.py b/product_harmonized_system/models/__init__.py new file mode 100644 index 000000000..cd4fd516c --- /dev/null +++ b/product_harmonized_system/models/__init__.py @@ -0,0 +1,3 @@ +from . import hs_code +from . import product_category +from . import product_template diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py new file mode 100644 index 000000000..fab42833f --- /dev/null +++ b/product_harmonized_system/models/hs_code.py @@ -0,0 +1,103 @@ +# Copyright 2011-2016 Akretion France (http://www.akretion.com) +# Copyright 2009-2016 Noviat (http://www.noviat.com) +# @author Alexis de Lattre +# @author Luc de Meyer +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class HSCode(models.Model): + _name = "hs.code" + _description = "H.S. Code" + _order = "local_code" + _rec_name = "local_code" + + hs_code = fields.Char( + string="H.S. Code", + compute="_compute_hs_code", + readonly=True, + help="Harmonized System code (6 digits). Full list is " + "available from the World Customs Organisation, see " + "http://www.wcoomd.org", + ) + description = fields.Char( + translate=True, help="Short text description of the H.S. category" + ) + local_code = fields.Char( + required=True, + help="Code used for the national Import/Export declaration. " + "The national code starts with the 6 digits of the H.S. and often " + "has a few additional digits to extend the H.S. code.", + ) + active = fields.Boolean(default=True) + company_id = fields.Many2one( + "res.company", + string="Company", + readonly=True, + required=True, + default=lambda self: self.env["res.company"]._company_default_get(), + ) + product_categ_ids = fields.One2many( + comodel_name="product.category", + inverse_name="hs_code_id", + string="Product Categories", + readonly=True, + ) + product_tmpl_ids = fields.One2many( + comodel_name="product.template", + inverse_name="hs_code_id", + string="Products", + readonly=True, + ) + product_categ_count = fields.Integer(compute="_compute_product_categ_count") + product_tmpl_count = fields.Integer(compute="_compute_product_tmpl_count") + + @api.depends("local_code") + def _compute_hs_code(self): + for this in self: + this.hs_code = this.local_code and this.local_code[:6] + + @api.depends("product_categ_ids") + def _compute_product_categ_count(self): + # hs_code_id on product.category is company_dependent=True + # so we can't use a read_group() + for code in self: + code.product_categ_count = len(code.product_categ_ids) + + @api.depends("product_tmpl_ids") + def _compute_product_tmpl_count(self): + # hs_code_id on product.template is company_dependent=True + # so we can't use a read_group() + for code in self: + code.product_tmpl_count = len(code.product_tmpl_ids) + + @api.depends("local_code", "description") + def name_get(self): + res = [] + for this in self: + name = this.local_code + if this.description: + name += " " + this.description + name = len(name) > 55 and name[:55] + "..." or name + res.append((this.id, name)) + return res + + _sql_constraints = [ + ( + "local_code_company_uniq", + "unique(local_code, company_id)", + "This code already exists for this company !", + ) + ] + + @api.model + def create(self, vals): + if vals.get("local_code"): + vals["local_code"] = vals["local_code"].replace(" ", "") + return super(HSCode, self).create(vals) + + def write(self, vals): + if vals.get("local_code"): + vals["local_code"] = vals["local_code"].replace(" ", "") + return super(HSCode, self).write(vals) diff --git a/product_harmonized_system/models/product_category.py b/product_harmonized_system/models/product_category.py new file mode 100644 index 000000000..e1950267d --- /dev/null +++ b/product_harmonized_system/models/product_category.py @@ -0,0 +1,31 @@ +# Copyright 2011-2016 Akretion France (http://www.akretion.com) +# Copyright 2009-2016 Noviat (http://www.noviat.com) +# @author Alexis de Lattre +# @author Luc de Meyer +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductCategory(models.Model): + _inherit = "product.category" + + hs_code_id = fields.Many2one( + "hs.code", + string="H.S. Code", + company_dependent=True, + ondelete="restrict", + help="Harmonised System Code. If this code is not " + "set on the product itself, it will be read here, on the " + "related product category.", + ) + + def get_hs_code_recursively(self): + self.ensure_one() + if self.hs_code_id: + res = self.hs_code_id + elif self.parent_id: + res = self.parent_id.get_hs_code_recursively() + else: + res = self.env["hs.code"] + return res diff --git a/product_harmonized_system/models/product_template.py b/product_harmonized_system/models/product_template.py new file mode 100644 index 000000000..dadf02dff --- /dev/null +++ b/product_harmonized_system/models/product_template.py @@ -0,0 +1,41 @@ +# Copyright 2011-2016 Akretion (http://www.akretion.com) +# Copyright 2009-2016 Noviat (http://www.noviat.com) +# @author Alexis de Lattre +# @author Luc de Meyer +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + hs_code_id = fields.Many2one( + "hs.code", + string="H.S. Code", + company_dependent=True, + ondelete="restrict", + help="Harmonised System Code. Nomenclature is " + "available from the World Customs Organisation, see " + "http://www.wcoomd.org/. You can leave this field empty " + "and configure the H.S. code on the product category.", + ) + origin_country_id = fields.Many2one( + "res.country", + string="Country of Origin", + help="Country of origin of the product i.e. product " "'made in ____'.", + ) + + +class ProductProduct(models.Model): + _inherit = "product.product" + + def get_hs_code_recursively(self): + res = self.env["hs.code"] + if self: + self.ensure_one() + if self.hs_code_id: + res = self.hs_code_id + elif self.categ_id: + res = self.categ_id.get_hs_code_recursively() + return res diff --git a/product_harmonized_system/readme/CONTRIBUTORS.rst b/product_harmonized_system/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..439f3b324 --- /dev/null +++ b/product_harmonized_system/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Alexis de Lattre, Akretion +* Luc De Meyer, Noviat +* Kumar Aberer, brain-tec AG diff --git a/product_harmonized_system/readme/DESCRIPTION.rst b/product_harmonized_system/readme/DESCRIPTION.rst new file mode 100644 index 000000000..2481baab1 --- /dev/null +++ b/product_harmonized_system/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +This module contains the objects for Harmonised System Codes (H.S. codes). The full nomenclature is available from the `World Customs Organisation `. These code are usually required on the Proforma invoices that are attached to the packages that are shipped abroad. + +This module also handle 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. + +This module should be usefull for all companies that export physical goods abroad. This module is also used by the Intrastat modules for the European Union, cf the *intrastat_product* module. diff --git a/product_harmonized_system/readme/INSTALL.rst b/product_harmonized_system/readme/INSTALL.rst new file mode 100644 index 000000000..5b11a6ab9 --- /dev/null +++ b/product_harmonized_system/readme/INSTALL.rst @@ -0,0 +1 @@ +This module is NOT compatible with the *account_intrastat* module from Odoo Enterprise. diff --git a/product_harmonized_system/readme/USAGE.rst b/product_harmonized_system/readme/USAGE.rst new file mode 100644 index 000000000..7d955cd2b --- /dev/null +++ b/product_harmonized_system/readme/USAGE.rst @@ -0,0 +1,3 @@ +As this module only depends on the *product* module and that module doesn't provide any menu entry, this module lacks a menu entry for H.S. Codes. A menu entry for H.S. codes is provided by the module *product_harmonized_system_stock*. + +Once the H.S. codes are created, you will be able to set the H.S. code on an product (under the *Information* tab) or on a product category. On the product form, you will also be able to set the *Country of Origin* of a product (for example, if the product is *made in China*, select *China* as *Country of Origin*). diff --git a/product_harmonized_system/security/ir.model.access.csv b/product_harmonized_system/security/ir.model.access.csv new file mode 100644 index 000000000..e22ebdd4b --- /dev/null +++ b/product_harmonized_system/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_hs_code_group_system,Full access on hs.code to Settings group,model_hs_code,base.group_system,1,1,1,1 +access_hs_code_read,Read access on hs.code to everybody,model_hs_code,,1,0,0,0 diff --git a/product_harmonized_system/security/product_hs_security.xml b/product_harmonized_system/security/product_hs_security.xml new file mode 100644 index 000000000..c7da6fb0e --- /dev/null +++ b/product_harmonized_system/security/product_hs_security.xml @@ -0,0 +1,10 @@ + + + + + HS Code Company rule + + ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + + + diff --git a/product_harmonized_system/static/description/icon.png b/product_harmonized_system/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 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 z z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zl&#s4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6# z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f# zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv! zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG z-wfS zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9 z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE# z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1 zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/product_harmonized_system/static/description/index.html b/product_harmonized_system/static/description/index.html new file mode 100644 index 000000000..7cfc809e6 --- /dev/null +++ b/product_harmonized_system/static/description/index.html @@ -0,0 +1,437 @@ + + + + + + +Product Harmonized System Codes + + + +
+

Product Harmonized System Codes

+ + +

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

+

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 code are usually required on the Proforma invoices that are attached to the packages that are shipped abroad.

+

This module also handle 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.

+

This module should be usefull for all companies that export physical goods abroad. This module is also used by the Intrastat modules for the European Union, cf the intrastat_product module.

+

Table of contents

+ +
+

Installation

+

This module is NOT compatible with the account_intrastat module from Odoo Enterprise.

+
+
+

Usage

+

As this module only depends on the product module and that module doesn’t provide any menu entry, this module lacks a menu entry for H.S. Codes. A menu entry for H.S. codes is provided by the module product_harmonized_system_stock.

+

Once the H.S. codes are created, you will be able to set the H.S. code on an product (under the Information tab) or on a product category. On the product form, you will also be able to set the Country of Origin of a product (for example, if the product is made in China, select China as Country of Origin).

+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • brain-tec AG
  • +
  • Akretion
  • +
  • Noviat
  • +
+
+
+

Contributors

+ +
+
+

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.

+

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/views/hs_code.xml b/product_harmonized_system/views/hs_code.xml new file mode 100644 index 000000000..93a5e46b8 --- /dev/null +++ b/product_harmonized_system/views/hs_code.xml @@ -0,0 +1,103 @@ + + + + + + + + hs.code.search + hs.code + + + + + + + + + + + hs.code.tree + hs.code + + + + + + + + + + + + + Product Categories + product.category + tree,form + [('hs_code_id', '=', active_id)] + + + + Products + product.template + kanban,tree,form + [('hs_code_id', '=', active_id)] + + + + + hs.code.form + hs.code + +
+
+ + + +
+ + + + + + +
+
+
+ + + + H.S. Codes + hs.code + tree,form + + + + +
diff --git a/product_harmonized_system/views/product_category.xml b/product_harmonized_system/views/product_category.xml new file mode 100644 index 000000000..419f2e0b6 --- /dev/null +++ b/product_harmonized_system/views/product_category.xml @@ -0,0 +1,24 @@ + + + + + + + + hs_code.product.category.form + product.category + + + + + + + + + + + diff --git a/product_harmonized_system/views/product_template.xml b/product_harmonized_system/views/product_template.xml new file mode 100644 index 000000000..b382e8c6a --- /dev/null +++ b/product_harmonized_system/views/product_template.xml @@ -0,0 +1,23 @@ + + + + + + + + hs_code.product.template.form + product.template + + + + + + + + + + From 8c31c320ea758e4870adda114f5374d73b1a2eb3 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Tue, 3 Mar 2020 20:29:11 +0100 Subject: [PATCH 02/35] [13.0][FIX]replace deprecated _company_default_get product_harmonized_system 13.0.1.0.1 pre-commit update --- product_harmonized_system/__manifest__.py | 2 +- .../demo/product_demo.xml | 121 +++++++------- product_harmonized_system/models/hs_code.py | 6 +- .../security/product_hs_security.xml | 12 +- product_harmonized_system/views/hs_code.xml | 150 ++++++++++-------- .../views/product_category.xml | 25 ++- .../views/product_template.xml | 27 ++-- 7 files changed, 172 insertions(+), 171 deletions(-) diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py index 8aa90ed33..cb18a9d3d 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -9,7 +9,7 @@ { "name": "Product Harmonized System Codes", - "version": "13.0.1.0.0", + "version": "13.0.1.0.1", "category": "Reporting", "license": "AGPL-3", "summary": "Base module for Product Import/Export reports", diff --git a/product_harmonized_system/demo/product_demo.xml b/product_harmonized_system/demo/product_demo.xml index 423f67d33..83022b811 100644 --- a/product_harmonized_system/demo/product_demo.xml +++ b/product_harmonized_system/demo/product_demo.xml @@ -1,75 +1,60 @@ - + - - - - - 84715000 - Automatic data-processing machines (computers) - - - - 84717050 - Storage units - - - - 85340090 - Printed circuits - - - - - - 8.7 - - - - - - 1.1 - - - - - - 8.2 - - - - - - 0.01 - - - - - - 0.67 - - - - - - 1.05 - - - - - - 0.3 - - - - - - 3.3 - - - + + 84715000 + Automatic data-processing machines (computers) + + + 84717050 + Storage units + + + 85340090 + Printed circuits + + + + + 8.7 + + + + + 1.1 + + + + + 8.2 + + + + + 0.01 + + + + + 0.67 + + + + + 1.05 + + + + + 0.3 + + + + + 3.3 + diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index fab42833f..b2ee7c825 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -36,7 +36,7 @@ class HSCode(models.Model): string="Company", readonly=True, required=True, - default=lambda self: self.env["res.company"]._company_default_get(), + default=lambda self: self._default_company_id(), ) product_categ_ids = fields.One2many( comodel_name="product.category", @@ -53,6 +53,10 @@ class HSCode(models.Model): product_categ_count = fields.Integer(compute="_compute_product_categ_count") product_tmpl_count = fields.Integer(compute="_compute_product_tmpl_count") + @api.model + def _default_company_id(self): + return self.env.company + @api.depends("local_code") def _compute_hs_code(self): for this in self: diff --git a/product_harmonized_system/security/product_hs_security.xml b/product_harmonized_system/security/product_hs_security.xml index c7da6fb0e..fc1a5e0a5 100644 --- a/product_harmonized_system/security/product_hs_security.xml +++ b/product_harmonized_system/security/product_hs_security.xml @@ -1,10 +1,10 @@ - + - - HS Code Company rule - - ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + HS Code Company rule + + ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] - diff --git a/product_harmonized_system/views/hs_code.xml b/product_harmonized_system/views/hs_code.xml index 93a5e46b8..1841ceda4 100644 --- a/product_harmonized_system/views/hs_code.xml +++ b/product_harmonized_system/views/hs_code.xml @@ -1,39 +1,41 @@ - + - - - hs.code.search - hs.code - - - - - - + hs.code.search + hs.code + + + + + + - - hs.code.tree - hs.code - - - - - - - - + hs.code.tree + hs.code + + + + + + + + - Product Categories @@ -41,63 +43,73 @@ tree,form [('hs_code_id', '=', active_id)] - Products product.template kanban,tree,form [('hs_code_id', '=', active_id)] - - hs.code.form - hs.code - -
-
- - - -
- - - - - - -
-
+ hs.code.form + hs.code + +
+
+ + + +
+ + + + + + +
+
- - H.S. Codes - hs.code - tree,form + H.S. Codes + hs.code + tree,form - -
diff --git a/product_harmonized_system/views/product_category.xml b/product_harmonized_system/views/product_category.xml index 419f2e0b6..eb58029f8 100644 --- a/product_harmonized_system/views/product_category.xml +++ b/product_harmonized_system/views/product_category.xml @@ -1,24 +1,21 @@ - + - - - hs_code.product.category.form - product.category - - - - - - - - + hs_code.product.category.form + product.category + + + + + + + + - diff --git a/product_harmonized_system/views/product_template.xml b/product_harmonized_system/views/product_template.xml index b382e8c6a..1907d8d45 100644 --- a/product_harmonized_system/views/product_template.xml +++ b/product_harmonized_system/views/product_template.xml @@ -1,23 +1,26 @@ - + - - - hs_code.product.template.form - product.template - - - - - + hs_code.product.template.form + product.template + + + + + + - - From 76415014668411257107eebf37702f32711b71da Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 8 Jun 2020 22:39:46 +0200 Subject: [PATCH 03/35] intrastat_product: Add xml_attachment_id field intrastat_product: add mail.activity.mixin and widget in form view product_harmonized_system: remove archive button (use Action menu) All modules: - use super() instead of super(class, self) - Update domain_force in multi-company ir.rule to v13 standard --- product_harmonized_system/models/hs_code.py | 4 ++-- .../security/product_hs_security.xml | 2 +- product_harmonized_system/views/hs_code.xml | 19 +++++++------------ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index b2ee7c825..475c39967 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -99,9 +99,9 @@ def name_get(self): def create(self, vals): if vals.get("local_code"): vals["local_code"] = vals["local_code"].replace(" ", "") - return super(HSCode, self).create(vals) + return super().create(vals) def write(self, vals): if vals.get("local_code"): vals["local_code"] = vals["local_code"].replace(" ", "") - return super(HSCode, self).write(vals) + return super().write(vals) diff --git a/product_harmonized_system/security/product_hs_security.xml b/product_harmonized_system/security/product_hs_security.xml index fc1a5e0a5..42c77617f 100644 --- a/product_harmonized_system/security/product_hs_security.xml +++ b/product_harmonized_system/security/product_hs_security.xml @@ -5,6 +5,6 @@ ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + >['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] diff --git a/product_harmonized_system/views/hs_code.xml b/product_harmonized_system/views/hs_code.xml index 1841ceda4..4b0316cdb 100644 --- a/product_harmonized_system/views/hs_code.xml +++ b/product_harmonized_system/views/hs_code.xml @@ -55,6 +55,13 @@ hs.code
+ +
- From 255511669a163dce7bdbb294310146818d5d08dc Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 19 Nov 2020 18:49:45 +0100 Subject: [PATCH 04/35] [MIG] product_harmonized_system to v14 [UPD] README.rst [UPD] Update product_harmonized_system.pot Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-14.0/intrastat-extrastat-14.0-product_harmonized_system Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-product_harmonized_system/ --- product_harmonized_system/README.rst | 29 +++++++++++++------ product_harmonized_system/__manifest__.py | 10 ++++--- .../demo/product_demo.xml | 2 +- product_harmonized_system/i18n/es.po | 23 ++++++++++++--- product_harmonized_system/i18n/fr.po | 15 +++++++--- .../i18n/product_harmonized_system.pot | 15 ++++++++-- product_harmonized_system/models/hs_code.py | 4 +-- .../models/product_category.py | 4 +-- .../models/product_template.py | 4 +-- .../readme/DESCRIPTION.rst | 6 ++-- product_harmonized_system/readme/USAGE.rst | 2 +- .../static/description/index.html | 16 +++++----- product_harmonized_system/views/hs_code.xml | 6 ++-- .../views/product_category.xml | 4 +-- .../views/product_template.xml | 2 +- 15 files changed, 94 insertions(+), 48 deletions(-) diff --git a/product_harmonized_system/README.rst b/product_harmonized_system/README.rst index eea323f45..2b224b21b 100644 --- a/product_harmonized_system/README.rst +++ b/product_harmonized_system/README.rst @@ -14,22 +14,22 @@ 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/13.0/product_harmonized_system + :target: https://github.com/OCA/intrastat-extrastat/tree/14.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-13-0/intrastat-extrastat-13-0-product_harmonized_system + :target: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-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/13.0 + :target: https://runbot.odoo-community.org/runbot/227/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| -This module contains the objects for Harmonised System Codes (H.S. codes). The full nomenclature is available from the `World Customs Organisation `. These code are usually required on the Proforma invoices that are attached to the packages that are shipped abroad. +This module contains the objects for Harmonised System Codes (H.S. codes). The full nomenclature is available from the `World Customs Organisation `. These codes are usually required on the Proforma invoices that are attached to the packages that are shipped abroad. -This module also handle 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. +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. +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. This module should be usefull for all companies that export physical goods abroad. This module is also used by the Intrastat modules for the European Union, cf the *intrastat_product* module. @@ -48,7 +48,7 @@ Usage As this module only depends on the *product* module and that module doesn't provide any menu entry, this module lacks a menu entry for H.S. Codes. A menu entry for H.S. codes is provided by the module *product_harmonized_system_stock*. -Once the H.S. codes are created, you will be able to set the H.S. code on an product (under the *Information* tab) or on a product category. On the product form, you will also be able to set the *Country of Origin* of a product (for example, if the product is *made in China*, select *China* as *Country of Origin*). +Once the H.S. codes are created, you will be able to set the H.S. code on a product (under the *Information* tab) or on a product category. On the product form, you will also be able to set the *Country of Origin* of a product (for example, if the product is *made in China*, select *China* as *Country of Origin*). Bug Tracker =========== @@ -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. @@ -90,6 +90,17 @@ 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. -This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. +.. |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/__manifest__.py b/product_harmonized_system/__manifest__.py index cb18a9d3d..054a13eb8 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -1,6 +1,6 @@ -# Copyright 2018 brain-tec AG (http://www.braintec-group.com) -# Copyright 2011-2016 Akretion (http://www.akretion.com) -# Copyright 2009-2019 Noviat (http://www.noviat.com) +# 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) # @author Benjamin Henquet # @author Kumar Aberer # @author Alexis de Lattre @@ -9,11 +9,13 @@ { "name": "Product Harmonized System Codes", - "version": "13.0.1.0.1", + "version": "14.0.1.0.0", "category": "Reporting", "license": "AGPL-3", "summary": "Base module for Product Import/Export reports", "author": "brain-tec AG, Akretion, Noviat, " "Odoo Community Association (OCA)", + "maintainers": ["alexis-via", "luc-demeyer"], + "website": "https://github.com/OCA/intrastat-extrastat", "depends": ["product"], "excludes": ["account_intrastat"], "data": [ diff --git a/product_harmonized_system/demo/product_demo.xml b/product_harmonized_system/demo/product_demo.xml index 83022b811..902f4a8c7 100644 --- a/product_harmonized_system/demo/product_demo.xml +++ b/product_harmonized_system/demo/product_demo.xml @@ -1,6 +1,6 @@ diff --git a/product_harmonized_system/i18n/es.po b/product_harmonized_system/i18n/es.po index 2f85e70b1..559999ef1 100644 --- a/product_harmonized_system/i18n/es.po +++ b/product_harmonized_system/i18n/es.po @@ -18,13 +18,13 @@ msgstr "" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form -msgid " Product Categs" -msgstr " Categs Producto" +msgid "Product Categs" +msgstr "" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form -msgid " Products" -msgstr " Productos" +msgid "Products" +msgstr "" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__active @@ -86,6 +86,9 @@ msgstr "Descripción" #. 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 "Nombre mostrado" @@ -135,6 +138,9 @@ 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 "" @@ -145,6 +151,9 @@ 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 "" @@ -224,3 +233,9 @@ msgstr "" #: 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 b49d68fa8..2e5b906c8 100644 --- a/product_harmonized_system/i18n/fr.po +++ b/product_harmonized_system/i18n/fr.po @@ -18,12 +18,12 @@ msgstr "" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form -msgid " Product Categs" +msgid "Product Categs" msgstr "" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form -msgid " Products" +msgid "Products" msgstr "" #. module: product_harmonized_system @@ -83,6 +83,9 @@ msgstr "Description" #. 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 "Nom affiché" @@ -128,6 +131,9 @@ 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 "ID" @@ -138,6 +144,9 @@ msgstr "Propriétés pour l'import/export" #. 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 #, fuzzy msgid "Last Modified on" msgstr "Dernière modification le" @@ -171,7 +180,6 @@ msgstr "Catégorie d'articles" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_count #, fuzzy -#| msgid "Product Category" msgid "Product Categ Count" msgstr "Catégorie d'articles" @@ -195,7 +203,6 @@ msgstr "Modèle d'article" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_count #, fuzzy -#| msgid "Product Template" msgid "Product Tmpl Count" msgstr "Modèle d'article" diff --git a/product_harmonized_system/i18n/product_harmonized_system.pot b/product_harmonized_system/i18n/product_harmonized_system.pot index 2be2b53fa..1ff4fa3f6 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 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -15,12 +15,12 @@ msgstr "" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form -msgid " Product Categs" +msgid "Product Categs" msgstr "" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form -msgid " Products" +msgid "Products" msgstr "" #. module: product_harmonized_system @@ -80,6 +80,9 @@ 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 "" @@ -124,6 +127,9 @@ 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 "" @@ -134,6 +140,9 @@ 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 "" diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index 475c39967..49d869e60 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -1,5 +1,5 @@ -# Copyright 2011-2016 Akretion France (http://www.akretion.com) -# Copyright 2009-2016 Noviat (http://www.noviat.com) +# Copyright 2011-2020 Akretion France (http://www.akretion.com) +# Copyright 2009-2020 Noviat (http://www.noviat.com) # @author Alexis de Lattre # @author Luc de Meyer # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/product_harmonized_system/models/product_category.py b/product_harmonized_system/models/product_category.py index e1950267d..d4400c986 100644 --- a/product_harmonized_system/models/product_category.py +++ b/product_harmonized_system/models/product_category.py @@ -1,5 +1,5 @@ -# Copyright 2011-2016 Akretion France (http://www.akretion.com) -# Copyright 2009-2016 Noviat (http://www.noviat.com) +# Copyright 2011-2020 Akretion France (http://www.akretion.com) +# Copyright 2009-2020 Noviat (http://www.noviat.com) # @author Alexis de Lattre # @author Luc de Meyer # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/product_harmonized_system/models/product_template.py b/product_harmonized_system/models/product_template.py index dadf02dff..b37ee0447 100644 --- a/product_harmonized_system/models/product_template.py +++ b/product_harmonized_system/models/product_template.py @@ -1,5 +1,5 @@ -# Copyright 2011-2016 Akretion (http://www.akretion.com) -# Copyright 2009-2016 Noviat (http://www.noviat.com) +# Copyright 2011-2020 Akretion (http://www.akretion.com) +# Copyright 2009-2020 Noviat (http://www.noviat.com) # @author Alexis de Lattre # @author Luc de Meyer # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/product_harmonized_system/readme/DESCRIPTION.rst b/product_harmonized_system/readme/DESCRIPTION.rst index 2481baab1..10aa1e89b 100644 --- a/product_harmonized_system/readme/DESCRIPTION.rst +++ b/product_harmonized_system/readme/DESCRIPTION.rst @@ -1,7 +1,7 @@ -This module contains the objects for Harmonised System Codes (H.S. codes). The full nomenclature is available from the `World Customs Organisation `. These code are usually required on the Proforma invoices that are attached to the packages that are shipped abroad. +This module contains the objects for Harmonised System Codes (H.S. codes). The full nomenclature is available from the `World Customs Organisation `. These codes are usually required on the Proforma invoices that are attached to the packages that are shipped abroad. -This module also handle 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. +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. +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. This module should be usefull for all companies that export physical goods abroad. This module is also used by the Intrastat modules for the European Union, cf the *intrastat_product* module. diff --git a/product_harmonized_system/readme/USAGE.rst b/product_harmonized_system/readme/USAGE.rst index 7d955cd2b..f3b64a56f 100644 --- a/product_harmonized_system/readme/USAGE.rst +++ b/product_harmonized_system/readme/USAGE.rst @@ -1,3 +1,3 @@ As this module only depends on the *product* module and that module doesn't provide any menu entry, this module lacks a menu entry for H.S. Codes. A menu entry for H.S. codes is provided by the module *product_harmonized_system_stock*. -Once the H.S. codes are created, you will be able to set the H.S. code on an product (under the *Information* tab) or on a product category. On the product form, you will also be able to set the *Country of Origin* of a product (for example, if the product is *made in China*, select *China* as *Country of Origin*). +Once the H.S. codes are created, you will be able to set the H.S. code on a product (under the *Information* tab) or on a product category. On the product form, you will also be able to set the *Country of Origin* of a product (for example, if the product is *made in China*, select *China* as *Country of Origin*). diff --git a/product_harmonized_system/static/description/index.html b/product_harmonized_system/static/description/index.html index 7cfc809e6..53a25028d 100644 --- a/product_harmonized_system/static/description/index.html +++ b/product_harmonized_system/static/description/index.html @@ -367,10 +367,10 @@

Product Harmonized System Codes

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

-

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 code are usually required on the Proforma invoices that are attached to the packages that are shipped abroad.

-

This module also handle 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.

+

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

+

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.

This module should be usefull for all companies that export physical goods abroad. This module is also used by the Intrastat modules for the European Union, cf the intrastat_product module.

Table of contents

@@ -393,14 +393,14 @@

Installation

Usage

As this module only depends on the product module and that module doesn’t provide any menu entry, this module lacks a menu entry for H.S. Codes. A menu entry for H.S. codes is provided by the module product_harmonized_system_stock.

-

Once the H.S. codes are created, you will be able to set the H.S. code on an product (under the Information tab) or on a product category. On the product form, you will also be able to set the Country of Origin of a product (for example, if the product is made in China, select China as Country of Origin).

+

Once the H.S. codes are created, you will be able to set the H.S. code on a product (under the Information tab) or on a product category. On the product form, you will also be able to set the Country of Origin of a product (for example, if the product is made in China, select China as Country of Origin).

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.

@@ -428,7 +428,9 @@

Maintainers

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.

-

This module is part of the OCA/intrastat-extrastat project on GitHub.

+

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/views/hs_code.xml b/product_harmonized_system/views/hs_code.xml index 4b0316cdb..3672f13fd 100644 --- a/product_harmonized_system/views/hs_code.xml +++ b/product_harmonized_system/views/hs_code.xml @@ -1,6 +1,6 @@ @@ -73,7 +73,7 @@ - Product Categs + Product Categs diff --git a/product_harmonized_system/views/product_category.xml b/product_harmonized_system/views/product_category.xml index eb58029f8..0017f944c 100644 --- a/product_harmonized_system/views/product_category.xml +++ b/product_harmonized_system/views/product_category.xml @@ -1,6 +1,6 @@ @@ -12,7 +12,7 @@ - + diff --git a/product_harmonized_system/views/product_template.xml b/product_harmonized_system/views/product_template.xml index 1907d8d45..8cdfd2e7c 100644 --- a/product_harmonized_system/views/product_template.xml +++ b/product_harmonized_system/views/product_template.xml @@ -1,6 +1,6 @@ From 5b79aae167741efdff1928783e357e477a5553cd Mon Sep 17 00:00:00 2001 From: Mat-moran Date: Sun, 21 Feb 2021 12:43:03 +0000 Subject: [PATCH 05/35] Translated using Weblate (Spanish) Currently translated at 80.5% (29 of 36 strings) Translation: intrastat-extrastat-14.0/intrastat-extrastat-14.0-product_harmonized_system Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-product_harmonized_system/es/ --- product_harmonized_system/i18n/es.po | 32 +++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/product_harmonized_system/i18n/es.po b/product_harmonized_system/i18n/es.po index 559999ef1..009cd369f 100644 --- a/product_harmonized_system/i18n/es.po +++ b/product_harmonized_system/i18n/es.po @@ -6,25 +6,25 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2019-11-10 18:34+0000\n" -"Last-Translator: Galoperd \n" +"PO-Revision-Date: 2021-02-21 14:45+0000\n" +"Last-Translator: Mat-moran \n" "Language-Team: none\n" "Language: es\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 3.8\n" +"X-Generator: Weblate 4.3.2\n" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form msgid "Product Categs" -msgstr "" +msgstr "Categorías de producto" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form msgid "Products" -msgstr "" +msgstr "Productos" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__active @@ -135,6 +135,8 @@ msgid "" "Harmonized System code (6 digits). Full list is available from the World " "Customs Organisation, see http://www.wcoomd.org" msgstr "" +"Sistema de códigos armonizado (6 dígitos). Lista completa disponible de la " +"World Customs Organisation, ver http://www.wcoomd.org" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__id @@ -142,7 +144,7 @@ msgstr "" #: 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 "" +msgstr "ID" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.product_category_form_view @@ -155,17 +157,17 @@ msgstr "" #: 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 "" +msgstr "Última modificación" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__write_uid msgid "Last Updated by" -msgstr "" +msgstr "Última actualización por" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__write_date msgid "Last Updated on" -msgstr "" +msgstr "Última actualización" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__local_code @@ -180,7 +182,7 @@ msgstr "" #. module: product_harmonized_system #: model:ir.model,name:product_harmonized_system.model_product_product msgid "Product" -msgstr "" +msgstr "Producto" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_count @@ -191,12 +193,12 @@ msgstr "" #: model:ir.actions.act_window,name:product_harmonized_system.product_categ_hs_code_action #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_ids msgid "Product Categories" -msgstr "" +msgstr "Categorías de producto" #. module: product_harmonized_system #: model:ir.model,name:product_harmonized_system.model_product_category msgid "Product Category" -msgstr "" +msgstr "Categoría de producto" #. module: product_harmonized_system #: model:ir.model,name:product_harmonized_system.model_product_template @@ -212,7 +214,7 @@ msgstr "" #: model:ir.actions.act_window,name:product_harmonized_system.product_template_hs_code_action #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_ids msgid "Products" -msgstr "" +msgstr "Productos" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_search @@ -222,12 +224,12 @@ 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" -msgstr "" +msgstr "Descripciones cortas de las categorías H.S." #. module: product_harmonized_system #: model:hs.code,description:product_harmonized_system.84717050 msgid "Storage units" -msgstr "" +msgstr "Unidades de almacenamiento" #. module: product_harmonized_system #: model:ir.model.constraint,message:product_harmonized_system.constraint_hs_code_local_code_company_uniq From ec9496b469241cc9d761946c2eb993ea681b22d8 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sun, 4 Jul 2021 19:56:17 +0000 Subject: [PATCH 06/35] Translated using Weblate (French) Currently translated at 100.0% (36 of 36 strings) Translation: intrastat-extrastat-14.0/intrastat-extrastat-14.0-product_harmonized_system Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-product_harmonized_system/fr/ --- product_harmonized_system/i18n/fr.po | 54 +++++++++++++++------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/product_harmonized_system/i18n/fr.po b/product_harmonized_system/i18n/fr.po index 2e5b906c8..0c359f4df 100644 --- a/product_harmonized_system/i18n/fr.po +++ b/product_harmonized_system/i18n/fr.po @@ -7,24 +7,25 @@ msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-07-16 13:11+0000\n" -"PO-Revision-Date: 2015-07-16 13:11+0000\n" -"Last-Translator: <>\n" +"PO-Revision-Date: 2021-07-04 21:48+0000\n" +"Last-Translator: Alexis de Lattre \n" "Language-Team: \n" -"Language: \n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form msgid "Product Categs" -msgstr "" +msgstr "Catégories d'article" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form msgid "Products" -msgstr "" +msgstr "Articles" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__active @@ -34,12 +35,12 @@ msgstr "Actif" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_search msgid "Archived" -msgstr "" +msgstr "Archivés" #. module: product_harmonized_system #: model:hs.code,description:product_harmonized_system.84715000 msgid "Automatic data-processing machines (computers)" -msgstr "" +msgstr "Machines de traitement automatique de l'information (ordinateurs)" #. module: product_harmonized_system #: model:ir.model.fields,help:product_harmonized_system.field_hs_code__local_code @@ -48,6 +49,9 @@ msgid "" "starts with the 6 digits of the H.S. and often has a few additional digits " "to extend the H.S. code." msgstr "" +"Code utilisé pour la déclaration nationale d'import/export. Le code national " +"commence par les 6 chiffres du système harmonisé et est souvent suivi de " +"quelques chiffres supplémentaires pour étendre le système harmonisé." #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__company_id @@ -64,7 +68,7 @@ msgstr "Pays d'origine" #: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_country_id #: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_country_id msgid "Country of origin of the product i.e. product 'made in ____'." -msgstr "" +msgstr "Pays d'origine de l'article i.e. article 'made in ____'." #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_uid @@ -102,9 +106,8 @@ msgstr "Code S.H." #. 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 -#, fuzzy msgid "H.S. Codes" -msgstr "Code S.H." +msgstr "Codes S.H." #. module: product_harmonized_system #: model:ir.model.fields,help:product_harmonized_system.field_product_category__hs_code_id @@ -112,6 +115,8 @@ msgid "" "Harmonised System Code. If this code is not set on the product itself, it " "will be read here, on the related product category." msgstr "" +"Code du système harmonisé. Si ce code n'est pas renseigné directement sur " +"l'article, il sera lu ici sur la catégorie d'article associée." #. module: product_harmonized_system #: model:ir.model.fields,help:product_harmonized_system.field_product_product__hs_code_id @@ -121,6 +126,9 @@ msgid "" "Organisation, see http://www.wcoomd.org/. You can leave this field empty and " "configure the H.S. code on the product category." msgstr "" +"Code du système harmonisé. La nomenclature est publiée par l'Organisation " +"Mondiale des Douanes, cf http://www.wcoomd.org/. Vous pouvez laisser ce " +"champ vide et renseigner le code S.H. sur la catégorie d'article." #. module: product_harmonized_system #: model:ir.model.fields,help:product_harmonized_system.field_hs_code__hs_code @@ -128,6 +136,8 @@ msgid "" "Harmonized System code (6 digits). Full list is available from the World " "Customs Organisation, see http://www.wcoomd.org" msgstr "" +"Code du système harmonisé (6 chiffres). La liste complète est publiée par " +"l'Organisation Mondiale des Douanes, cf http://www.wcoomd.org" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__id @@ -147,7 +157,6 @@ msgstr "Propriétés pour l'import/export" #: 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 -#, fuzzy msgid "Last Modified on" msgstr "Dernière modification le" @@ -169,26 +178,23 @@ msgstr "Code local" #. module: product_harmonized_system #: model:hs.code,description:product_harmonized_system.85340090 msgid "Printed circuits" -msgstr "" +msgstr "Circuits imprimés" #. module: product_harmonized_system #: model:ir.model,name:product_harmonized_system.model_product_product -#, fuzzy msgid "Product" -msgstr "Catégorie d'articles" +msgstr "Article" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_count -#, fuzzy msgid "Product Categ Count" -msgstr "Catégorie d'articles" +msgstr "Nombre de catégories d'article" #. module: product_harmonized_system #: model:ir.actions.act_window,name:product_harmonized_system.product_categ_hs_code_action #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_ids -#, fuzzy msgid "Product Categories" -msgstr "Catégorie d'articles" +msgstr "Catégories d'article" #. module: product_harmonized_system #: model:ir.model,name:product_harmonized_system.model_product_category @@ -202,31 +208,29 @@ msgstr "Modèle d'article" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_count -#, fuzzy msgid "Product Tmpl Count" -msgstr "Modèle d'article" +msgstr "Nombre de modèles d'article" #. module: product_harmonized_system #: model:ir.actions.act_window,name:product_harmonized_system.product_template_hs_code_action #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_ids msgid "Products" -msgstr "" +msgstr "Articles" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_search -#, fuzzy msgid "Search H.S. Codes" msgstr "Recherche dans les codes S.H." #. 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" -msgstr "Courte description de la catégorie H.S." +msgstr "Courte description de la catégorie S.H." #. module: product_harmonized_system #: model:hs.code,description:product_harmonized_system.84717050 msgid "Storage units" -msgstr "" +msgstr "Unités de stockage" #. module: product_harmonized_system #: model:ir.model.constraint,message:product_harmonized_system.constraint_hs_code_local_code_company_uniq From a1992abb3c826aa86423f488df68da3f77aa5ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Gil=20Sorribes?= Date: Wed, 19 May 2021 10:56:01 +0200 Subject: [PATCH 07/35] [13.0] product_harmonized_system: do not require company on hs_code model product_harmonized_system 14.0.1.0.1 --- product_harmonized_system/__manifest__.py | 2 +- product_harmonized_system/models/hs_code.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py index 054a13eb8..93d9b843e 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -9,7 +9,7 @@ { "name": "Product Harmonized System Codes", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "category": "Reporting", "license": "AGPL-3", "summary": "Base module for Product Import/Export reports", diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index 49d869e60..245cb3d64 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -34,8 +34,6 @@ class HSCode(models.Model): company_id = fields.Many2one( "res.company", string="Company", - readonly=True, - required=True, default=lambda self: self._default_company_id(), ) product_categ_ids = fields.One2many( From 260c8a469d63d3c3ce70504c3fa58ef84716a8dd Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 13 Dec 2021 01:01:01 +0100 Subject: [PATCH 08/35] [MIG] hs_code_id company_dependent=True to False Migration script provided for product.template and product.category Fixes bug #126 --- product_harmonized_system/__manifest__.py | 2 +- .../migrations/14.0.2.0.0/post-migration.py | 45 +++++++++++++++++++ .../models/product_category.py | 4 +- .../models/product_template.py | 4 +- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 product_harmonized_system/migrations/14.0.2.0.0/post-migration.py diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py index 93d9b843e..466492272 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -9,7 +9,7 @@ { "name": "Product Harmonized System Codes", - "version": "14.0.1.0.1", + "version": "14.0.2.0.0", "category": "Reporting", "license": "AGPL-3", "summary": "Base module for Product Import/Export reports", 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 new file mode 100644 index 000000000..2319cf261 --- /dev/null +++ b/product_harmonized_system/migrations/14.0.2.0.0/post-migration.py @@ -0,0 +1,45 @@ +# 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/product_category.py b/product_harmonized_system/models/product_category.py index d4400c986..89d10a311 100644 --- a/product_harmonized_system/models/product_category.py +++ b/product_harmonized_system/models/product_category.py @@ -13,7 +13,9 @@ class ProductCategory(models.Model): hs_code_id = fields.Many2one( "hs.code", string="H.S. Code", - company_dependent=True, + # 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 b37ee0447..4670cfc74 100644 --- a/product_harmonized_system/models/product_template.py +++ b/product_harmonized_system/models/product_template.py @@ -13,7 +13,9 @@ class ProductTemplate(models.Model): hs_code_id = fields.Many2one( "hs.code", string="H.S. Code", - company_dependent=True, + # 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 " From 05639fa71254860cf359e9a8c7db20fc2b826360 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 16 Dec 2021 17:23:37 +0100 Subject: [PATCH 09/35] product_harmonized_system_delivery: hs_code is now store=True This commit is the "followup" of the change to company_dependent=False on the fields hs_code_id on product.template and product.category. Add groupby on hs_code_id on product.template search view hs.code is now company_id=False by default [UPD] Update product_harmonized_system.pot product_harmonized_system 14.0.2.1.0 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-14.0/intrastat-extrastat-14.0-product_harmonized_system Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-product_harmonized_system/ --- product_harmonized_system/__manifest__.py | 2 +- product_harmonized_system/i18n/es.po | 1 + product_harmonized_system/i18n/fr.po | 1 + .../i18n/product_harmonized_system.pot | 1 + product_harmonized_system/models/hs_code.py | 2 +- .../views/product_template.xml | 13 +++++++++++++ 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py index 466492272..573079594 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -9,7 +9,7 @@ { "name": "Product Harmonized System Codes", - "version": "14.0.2.0.0", + "version": "14.0.2.1.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 009cd369f..14f926c59 100644 --- a/product_harmonized_system/i18n/es.po +++ b/product_harmonized_system/i18n/es.po @@ -99,6 +99,7 @@ msgstr "Nombre mostrado" #: 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 "Código HS" diff --git a/product_harmonized_system/i18n/fr.po b/product_harmonized_system/i18n/fr.po index 0c359f4df..8802d3d06 100644 --- a/product_harmonized_system/i18n/fr.po +++ b/product_harmonized_system/i18n/fr.po @@ -100,6 +100,7 @@ msgstr "Nom affiché" #: 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 "Code S.H." diff --git a/product_harmonized_system/i18n/product_harmonized_system.pot b/product_harmonized_system/i18n/product_harmonized_system.pot index 1ff4fa3f6..700b40067 100644 --- a/product_harmonized_system/i18n/product_harmonized_system.pot +++ b/product_harmonized_system/i18n/product_harmonized_system.pot @@ -93,6 +93,7 @@ msgstr "" #: 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 "" diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index 245cb3d64..da8cf116b 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -53,7 +53,7 @@ class HSCode(models.Model): @api.model def _default_company_id(self): - return self.env.company + return False @api.depends("local_code") def _compute_hs_code(self): diff --git a/product_harmonized_system/views/product_template.xml b/product_harmonized_system/views/product_template.xml index 8cdfd2e7c..59fa83efc 100644 --- a/product_harmonized_system/views/product_template.xml +++ b/product_harmonized_system/views/product_template.xml @@ -23,4 +23,17 @@ + + product.template + + + + + + + From c405a313bba4d99e5eade0341118a9881b7e107d Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Sun, 26 Dec 2021 13:51:33 +0100 Subject: [PATCH 10/35] [14.0]Intrastat Brexit support --- product_harmonized_system/models/product_template.py | 12 +++++++++++- product_harmonized_system/views/product_template.xml | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/product_harmonized_system/models/product_template.py b/product_harmonized_system/models/product_template.py index 4670cfc74..d524206cc 100644 --- a/product_harmonized_system/models/product_template.py +++ b/product_harmonized_system/models/product_template.py @@ -23,10 +23,20 @@ class ProductTemplate(models.Model): "and configure the H.S. code on the product category.", ) origin_country_id = fields.Many2one( - "res.country", + comodel_name="res.country", string="Country of Origin", help="Country of origin of the product i.e. product " "'made in ____'.", ) + origin_state_id = fields.Many2one( + comodel_name="res.country.state", + string="Country State of Origin", + domain="[('country_id', '=?', origin_country_id)]", + help="Country State of origin of the product.\n" + "This field is used for the Intrastat declaration, " + "selecting 'Northern Ireland' will set the code 'XI' " + "for products from the United Kingdom whereas code 'XU' " + "will be used for the other UK states.", + ) class ProductProduct(models.Model): diff --git a/product_harmonized_system/views/product_template.xml b/product_harmonized_system/views/product_template.xml index 59fa83efc..79d2b2713 100644 --- a/product_harmonized_system/views/product_template.xml +++ b/product_harmonized_system/views/product_template.xml @@ -20,6 +20,10 @@ name="origin_country_id" attrs="{'invisible': [('type', '=', 'service')]}" /> +
From b700a83c10de1f27d2f7d7d3cbb2c088aa3eae71 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Mon, 2 May 2022 15:35:56 +0200 Subject: [PATCH 11/35] [14.0]intrastat - improved brexit support [UPD] Update product_harmonized_system.pot product_harmonized_system 14.0.2.2.0 Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-14.0/intrastat-extrastat-14.0-product_harmonized_system Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-product_harmonized_system/ --- product_harmonized_system/__manifest__.py | 2 +- product_harmonized_system/i18n/es.po | 16 ++++++++++++++++ product_harmonized_system/i18n/fr.po | 16 ++++++++++++++++ .../i18n/product_harmonized_system.pot | 14 ++++++++++++++ .../models/product_template.py | 4 ++-- 5 files changed, 49 insertions(+), 3 deletions(-) diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py index 573079594..2eddfb085 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -9,7 +9,7 @@ { "name": "Product Harmonized System Codes", - "version": "14.0.2.1.0", + "version": "14.0.2.2.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 14f926c59..edb487532 100644 --- a/product_harmonized_system/i18n/es.po +++ b/product_harmonized_system/i18n/es.po @@ -57,6 +57,22 @@ msgstr "" msgid "Company" msgstr "Compañía" +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_product_product__origin_state_id +#: model:ir.model.fields,field_description:product_harmonized_system.field_product_template__origin_state_id +msgid "Country State of Origin" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_state_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_state_id +msgid "" +"Country State of origin of the product.\n" +"This field is used for the Intrastat declaration, selecting one of the " +"Northern Ireland counties will set the code 'XI' for products from the " +"United Kingdom whereas code 'XU' will be used for the other UK counties." +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 diff --git a/product_harmonized_system/i18n/fr.po b/product_harmonized_system/i18n/fr.po index 8802d3d06..44015c2d2 100644 --- a/product_harmonized_system/i18n/fr.po +++ b/product_harmonized_system/i18n/fr.po @@ -58,6 +58,22 @@ msgstr "" msgid "Company" msgstr "Société" +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_product_product__origin_state_id +#: model:ir.model.fields,field_description:product_harmonized_system.field_product_template__origin_state_id +msgid "Country State of Origin" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_state_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_state_id +msgid "" +"Country State of origin of the product.\n" +"This field is used for the Intrastat declaration, selecting one of the " +"Northern Ireland counties will set the code 'XI' for products from the " +"United Kingdom whereas code 'XU' will be used for the other UK counties." +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 diff --git a/product_harmonized_system/i18n/product_harmonized_system.pot b/product_harmonized_system/i18n/product_harmonized_system.pot index 700b40067..43ddf6400 100644 --- a/product_harmonized_system/i18n/product_harmonized_system.pot +++ b/product_harmonized_system/i18n/product_harmonized_system.pot @@ -51,6 +51,20 @@ msgstr "" msgid "Company" msgstr "" +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_product_product__origin_state_id +#: model:ir.model.fields,field_description:product_harmonized_system.field_product_template__origin_state_id +msgid "Country State of Origin" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_state_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_state_id +msgid "" +"Country State of origin of the product.\n" +"This field is used for the Intrastat declaration, selecting one of the Northern Ireland counties will set the code 'XI' for products from the United Kingdom whereas code 'XU' will be used for the other UK counties." +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 diff --git a/product_harmonized_system/models/product_template.py b/product_harmonized_system/models/product_template.py index d524206cc..902deeaa4 100644 --- a/product_harmonized_system/models/product_template.py +++ b/product_harmonized_system/models/product_template.py @@ -33,9 +33,9 @@ class ProductTemplate(models.Model): domain="[('country_id', '=?', origin_country_id)]", help="Country State of origin of the product.\n" "This field is used for the Intrastat declaration, " - "selecting 'Northern Ireland' will set the code 'XI' " + "selecting one of the Northern Ireland counties will set the code 'XI' " "for products from the United Kingdom whereas code 'XU' " - "will be used for the other UK states.", + "will be used for the other UK counties.", ) From ffb4f53652e98fef1c21960c79275ae89dc8e806 Mon Sep 17 00:00:00 2001 From: Yu Weng Date: Fri, 17 Jun 2022 16:16:58 +0200 Subject: [PATCH 12/35] [IMP] add tag 'sheet' into form view of hs.code product_harmonized_system 14.0.2.3.0 --- product_harmonized_system/__manifest__.py | 2 +- product_harmonized_system/views/hs_code.xml | 84 +++++++++++---------- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py index 2eddfb085..29158ed74 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -9,7 +9,7 @@ { "name": "Product Harmonized System Codes", - "version": "14.0.2.2.0", + "version": "14.0.2.3.0", "category": "Reporting", "license": "AGPL-3", "summary": "Base module for Product Import/Export reports", diff --git a/product_harmonized_system/views/hs_code.xml b/product_harmonized_system/views/hs_code.xml index 3672f13fd..564528d77 100644 --- a/product_harmonized_system/views/hs_code.xml +++ b/product_harmonized_system/views/hs_code.xml @@ -55,47 +55,49 @@ hs.code - - -
- - -
- - - - - - + + + +
+ + +
+ + + + + + +
From c954fbb98e08049aa3e704907e6ed628fc87e853 Mon Sep 17 00:00:00 2001 From: Bole Date: Fri, 1 Jul 2022 07:40:30 +0000 Subject: [PATCH 13/35] Added translation using Weblate (Croatian) --- product_harmonized_system/i18n/hr.po | 241 +++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 product_harmonized_system/i18n/hr.po diff --git a/product_harmonized_system/i18n/hr.po b/product_harmonized_system/i18n/hr.po new file mode 100644 index 000000000..4cfa1199e --- /dev/null +++ b/product_harmonized_system/i18n/hr.po @@ -0,0 +1,241 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_harmonized_system +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\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" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form +msgid "Product Categs" +msgstr "" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form +msgid "Products" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__active +msgid "Active" +msgstr "" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_search +msgid "Archived" +msgstr "" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.84715000 +msgid "Automatic data-processing machines (computers)" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_hs_code__local_code +msgid "" +"Code used for the national Import/Export declaration. The national code " +"starts with the 6 digits of the H.S. and often has a few additional digits " +"to extend the H.S. code." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__company_id +msgid "Company" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_product_product__origin_state_id +#: model:ir.model.fields,field_description:product_harmonized_system.field_product_template__origin_state_id +msgid "Country State of Origin" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_state_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_state_id +msgid "" +"Country State of origin of the product.\n" +"This field is used for the Intrastat declaration, selecting one of the Northern Ireland counties will set the code 'XI' for products from the United Kingdom whereas code 'XU' will be used for the other UK counties." +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 +msgid "Country of Origin" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_country_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_country_id +msgid "Country of origin of the product i.e. product 'made in ____'." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_uid +msgid "Created by" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_date +msgid "Created on" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__description +msgid "Description" +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 "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_hs_code +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__hs_code +#: 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 "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_category__hs_code_id +msgid "" +"Harmonised System Code. If this code is not set on the product itself, it " +"will be read here, on the related product category." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_product_product__hs_code_id +#: model:ir.model.fields,help:product_harmonized_system.field_product_template__hs_code_id +msgid "" +"Harmonised System Code. Nomenclature is available from the World Customs " +"Organisation, see http://www.wcoomd.org/. You can leave this field empty and" +" configure the H.S. code on the product category." +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,help:product_harmonized_system.field_hs_code__hs_code +msgid "" +"Harmonized System code (6 digits). Full list is available from the World " +"Customs Organisation, see http://www.wcoomd.org" +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 "" + +#. module: product_harmonized_system +#: model_terms:ir.ui.view,arch_db:product_harmonized_system.product_category_form_view +msgid "Import/Export Properties" +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 "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__write_date +msgid "Last Updated on" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__local_code +msgid "Local Code" +msgstr "" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.85340090 +msgid "Printed circuits" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_product +msgid "Product" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_count +msgid "Product Categ Count" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.actions.act_window,name:product_harmonized_system.product_categ_hs_code_action +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_categ_ids +msgid "Product Categories" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_category +msgid "Product Category" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model,name:product_harmonized_system.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_count +msgid "Product Tmpl Count" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.actions.act_window,name:product_harmonized_system.product_template_hs_code_action +#: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__product_tmpl_ids +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" +msgstr "" + +#. module: product_harmonized_system +#: model:hs.code,description:product_harmonized_system.84717050 +msgid "Storage units" +msgstr "" + +#. module: product_harmonized_system +#: model:ir.model.constraint,message:product_harmonized_system.constraint_hs_code_local_code_company_uniq +msgid "This code already exists for this company !" +msgstr "" From 0b1ebcba8b3ba2887bcc01e09022b5502ec10cb0 Mon Sep 17 00:00:00 2001 From: Bole Date: Fri, 1 Jul 2022 07:47:38 +0000 Subject: [PATCH 14/35] Translated using Weblate (Croatian) Currently translated at 10.5% (4 of 38 strings) Translation: intrastat-extrastat-14.0/intrastat-extrastat-14.0-product_harmonized_system Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-product_harmonized_system/hr/ --- product_harmonized_system/i18n/hr.po | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/product_harmonized_system/i18n/hr.po b/product_harmonized_system/i18n/hr.po index 4cfa1199e..f943df94b 100644 --- a/product_harmonized_system/i18n/hr.po +++ b/product_harmonized_system/i18n/hr.po @@ -6,7 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2022-07-01 10:05+0000\n" +"Last-Translator: Bole \n" "Language-Team: none\n" "Language: hr\n" "MIME-Version: 1.0\n" @@ -14,6 +15,7 @@ msgstr "" "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.3.2\n" #. module: product_harmonized_system #: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form @@ -51,13 +53,13 @@ msgstr "" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__company_id msgid "Company" -msgstr "" +msgstr "Tvrtka" #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_product_product__origin_state_id #: model:ir.model.fields,field_description:product_harmonized_system.field_product_template__origin_state_id msgid "Country State of Origin" -msgstr "" +msgstr "Regija države porijekla" #. module: product_harmonized_system #: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_state_id @@ -71,13 +73,13 @@ msgstr "" #: 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 msgid "Country of Origin" -msgstr "" +msgstr "Država porijekla" #. module: product_harmonized_system #: model:ir.model.fields,help:product_harmonized_system.field_product_product__origin_country_id #: model:ir.model.fields,help:product_harmonized_system.field_product_template__origin_country_id msgid "Country of origin of the product i.e. product 'made in ____'." -msgstr "" +msgstr "Država porijekla proizvoda, nrp: proizvod je 'made in ______'." #. module: product_harmonized_system #: model:ir.model.fields,field_description:product_harmonized_system.field_hs_code__create_uid From 791a81183d6cc9c582fc89c80181b3c93a5b162e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 16 Dec 2021 17:13:09 +0100 Subject: [PATCH 15/35] [MIG] product_harmonized_system to v15 TT36971 --- product_harmonized_system/README.rst | 10 ++--- product_harmonized_system/__manifest__.py | 3 +- product_harmonized_system/i18n/es.po | 6 --- product_harmonized_system/i18n/fr.po | 13 ------ .../migrations/14.0.2.0.0/post-migration.py | 45 ------------------- product_harmonized_system/models/hs_code.py | 4 +- .../models/product_category.py | 3 -- .../models/product_template.py | 3 -- .../static/description/index.html | 8 ++-- product_harmonized_system/views/hs_code.xml | 8 ++-- 10 files changed, 18 insertions(+), 85 deletions(-) delete mode 100644 product_harmonized_system/migrations/14.0.2.0.0/post-migration.py diff --git a/product_harmonized_system/README.rst b/product_harmonized_system/README.rst index 2b224b21b..bf782744d 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 29158ed74..d33ac4d30 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 edb487532..2ad55fc9a 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 44015c2d2..46d0da4eb 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 2319cf261..000000000 --- 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 da8cf116b..89c1000ed 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 @@ def name_get(self): 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 89d10a311..e9d97507d 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 902deeaa4..7aa950de8 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 53a25028d..52390f961 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