From 8900aeecd72ec2902653d6cb1b25d4d5b911a8f4 Mon Sep 17 00:00:00 2001 From: BenjaHe Date: Thu, 19 Dec 2019 09:18:09 +0100 Subject: [PATCH 01/16] [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 0000000..eea323f --- /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 0000000..0650744 --- /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 0000000..8aa90ed --- /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 0000000..423f67d --- /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 0000000..2f85e70 --- /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 0000000..b49d68f --- /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 0000000..2be2b53 --- /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 0000000..cd4fd51 --- /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 0000000..fab4283 --- /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 0000000..e195026 --- /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 0000000..dadf02d --- /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 0000000..439f3b3 --- /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 0000000..2481baa --- /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 0000000..5b11a6a --- /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 0000000..7d955cd --- /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 0000000..e22ebdd --- /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 0000000..c7da6fb --- /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 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 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 0000000..7cfc809 --- /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 0000000..93a5e46 --- /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 0000000..419f2e0 --- /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 0000000..b382e8c --- /dev/null +++ b/product_harmonized_system/views/product_template.xml @@ -0,0 +1,23 @@ + + + + + + + + hs_code.product.template.form + product.template + + + + + + + + + + From c5ee5b54b61dd1fb355a42538074dbb8b88983c2 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Tue, 3 Mar 2020 20:29:11 +0100 Subject: [PATCH 02/16] [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 8aa90ed..cb18a9d 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 423f67d..83022b8 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 fab4283..b2ee7c8 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 c7da6fb..fc1a5e0 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 93a5e46..1841ced 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 419f2e0..eb58029 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 b382e8c..1907d8d 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 79583cbe640bcca6ca46de916c9e380bc4918867 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 8 Jun 2020 22:39:46 +0200 Subject: [PATCH 03/16] 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 b2ee7c8..475c399 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -99,9 +99,9 @@ class HSCode(models.Model): 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 fc1a5e0..42c7761 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 1841ced..4b0316c 100644 --- a/product_harmonized_system/views/hs_code.xml +++ b/product_harmonized_system/views/hs_code.xml @@ -55,6 +55,13 @@ hs.code
+ +
- From 786953fa0223b56226471099781f7f763dddac03 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 19 Nov 2020 18:49:45 +0100 Subject: [PATCH 04/16] [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 eea323f..2b224b2 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 cb18a9d..054a13e 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 83022b8..902f4a8 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 2f85e70..559999e 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 b49d68f..2e5b906 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 2be2b53..1ff4fa3 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 475c399..49d869e 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 e195026..d4400c9 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 dadf02d..b37ee04 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 2481baa..10aa1e8 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 7d955cd..f3b64a5 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 7cfc809..53a2502 100644 --- a/product_harmonized_system/static/description/index.html +++ b/product_harmonized_system/static/description/index.html @@ -367,10 +367,10 @@ ul.auto-toc { !! 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 @@ ul.auto-toc {

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 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

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 4b0316c..3672f13 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 eb58029..0017f94 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 1907d8d..8cdfd2e 100644 --- a/product_harmonized_system/views/product_template.xml +++ b/product_harmonized_system/views/product_template.xml @@ -1,6 +1,6 @@ From 04cf295910cc1d637713235a24c55151f3c5ca7f Mon Sep 17 00:00:00 2001 From: Mat-moran Date: Sun, 21 Feb 2021 12:43:03 +0000 Subject: [PATCH 05/16] 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 559999e..009cd36 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 fc423c5943d5d475f209cc86da5c56ae78c8caf4 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sun, 4 Jul 2021 19:56:17 +0000 Subject: [PATCH 06/16] 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 2e5b906..0c359f4 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 71f4a3854f630411c51682251e0de61629df173f 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/16] [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 054a13e..93d9b84 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 49d869e..245cb3d 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 d97f17a82fe2438370db188b9165a2815d4dcc35 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 13 Dec 2021 01:01:01 +0100 Subject: [PATCH 08/16] [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 93d9b84..4664922 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 0000000..2319cf2 --- /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 d4400c9..89d10a3 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 b37ee04..4670cfc 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 4a7006746bccc56ae44c6313eb89d029896bc878 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 16 Dec 2021 17:23:37 +0100 Subject: [PATCH 09/16] 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 4664922..5730795 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 009cd36..14f926c 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 0c359f4..8802d3d 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 1ff4fa3..700b400 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 245cb3d..da8cf11 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 8cdfd2e..59fa83e 100644 --- a/product_harmonized_system/views/product_template.xml +++ b/product_harmonized_system/views/product_template.xml @@ -23,4 +23,17 @@ + + product.template + + + + + + + From c4d36e79a77331ff168d662b9c9869e46a020760 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Sun, 26 Dec 2021 13:51:33 +0100 Subject: [PATCH 10/16] [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 4670cfc..d524206 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 59fa83e..79d2b27 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 91c07f169b7cb39f691f3aed66de56ff736f2e86 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Mon, 2 May 2022 15:35:56 +0200 Subject: [PATCH 11/16] [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 5730795..2eddfb0 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 14f926c..edb4875 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 8802d3d..44015c2 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 700b400..43ddf64 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 d524206..902deea 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 4b8a6204c77f574b0e4c36acb455adacfd0155ca Mon Sep 17 00:00:00 2001 From: Yu Weng Date: Fri, 17 Jun 2022 16:16:58 +0200 Subject: [PATCH 12/16] [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 2eddfb0..29158ed 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 3672f13..564528d 100644 --- a/product_harmonized_system/views/hs_code.xml +++ b/product_harmonized_system/views/hs_code.xml @@ -55,47 +55,49 @@ hs.code - - -
- - -
- - - - - - + + + +
+ + +
+ + + + + + +
From ea9f9abc7b492d5442a3bb3c253f08246d1f88f5 Mon Sep 17 00:00:00 2001 From: Bole Date: Fri, 1 Jul 2022 07:40:30 +0000 Subject: [PATCH 13/16] 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 0000000..4cfa119 --- /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 fdd3bf5533dbf429d73ba614b04485056a8897ac Mon Sep 17 00:00:00 2001 From: Bole Date: Fri, 1 Jul 2022 07:47:38 +0000 Subject: [PATCH 14/16] 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 4cfa119..f943df9 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 c7046838a5116fb63168cdb205afda94245aad96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 2 Aug 2022 09:17:35 +0200 Subject: [PATCH 15/16] [IMP] product_harmonized_system: black, isort, prettier --- .../odoo/addons/product_harmonized_system | 1 + setup/product_harmonized_system/setup.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 120000 setup/product_harmonized_system/odoo/addons/product_harmonized_system create mode 100644 setup/product_harmonized_system/setup.py diff --git a/setup/product_harmonized_system/odoo/addons/product_harmonized_system b/setup/product_harmonized_system/odoo/addons/product_harmonized_system new file mode 120000 index 0000000..40ab03b --- /dev/null +++ b/setup/product_harmonized_system/odoo/addons/product_harmonized_system @@ -0,0 +1 @@ +../../../../product_harmonized_system \ No newline at end of file diff --git a/setup/product_harmonized_system/setup.py b/setup/product_harmonized_system/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/product_harmonized_system/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From 379b73e11d48c990add6bd3e05ce4a1fd8dcadcd Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 16 Dec 2021 17:13:09 +0100 Subject: [PATCH 16/16] [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 2b224b2..bf78274 100644 --- a/product_harmonized_system/README.rst +++ b/product_harmonized_system/README.rst @@ -14,13 +14,13 @@ Product Harmonized System Codes :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fintrastat--extrastat-lightgray.png?logo=github - :target: https://github.com/OCA/intrastat-extrastat/tree/14.0/product_harmonized_system + :target: https://github.com/OCA/intrastat-extrastat/tree/15.0/product_harmonized_system :alt: OCA/intrastat-extrastat .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-product_harmonized_system + :target: https://translation.odoo-community.org/projects/intrastat-extrastat-15-0/intrastat-extrastat-15-0-product_harmonized_system :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/227/14.0 + :target: https://runbot.odoo-community.org/runbot/227/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -56,7 +56,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -101,6 +101,6 @@ Current `maintainers `__: |maintainer-alexis-via| |maintainer-luc-demeyer| -This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. +This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_harmonized_system/__manifest__.py b/product_harmonized_system/__manifest__.py index 29158ed..d33ac4d 100644 --- a/product_harmonized_system/__manifest__.py +++ b/product_harmonized_system/__manifest__.py @@ -1,6 +1,7 @@ # Copyright 2018-2020 brain-tec AG (http://www.braintec-group.com) # Copyright 2011-2020 Akretion (http://www.akretion.com) # Copyright 2009-2020 Noviat (http://www.noviat.com) +# Copyright 2022 Tecnativa - Víctor Martínez # @author Benjamin Henquet # @author Kumar Aberer # @author Alexis de Lattre @@ -9,7 +10,7 @@ { "name": "Product Harmonized System Codes", - "version": "14.0.2.3.0", + "version": "15.0.1.0.0", "category": "Reporting", "license": "AGPL-3", "summary": "Base module for Product Import/Export reports", diff --git a/product_harmonized_system/i18n/es.po b/product_harmonized_system/i18n/es.po index edb4875..2ad55fc 100644 --- a/product_harmonized_system/i18n/es.po +++ b/product_harmonized_system/i18n/es.po @@ -252,9 +252,3 @@ msgstr "Unidades de almacenamiento" #: model:ir.model.constraint,message:product_harmonized_system.constraint_hs_code_local_code_company_uniq msgid "This code already exists for this company !" msgstr "Este código ya existe para esta compañía !" - -#~ msgid " Product Categs" -#~ msgstr " Categs Producto" - -#~ msgid " Products" -#~ msgstr " Productos" diff --git a/product_harmonized_system/i18n/fr.po b/product_harmonized_system/i18n/fr.po index 44015c2..46d0da4 100644 --- a/product_harmonized_system/i18n/fr.po +++ b/product_harmonized_system/i18n/fr.po @@ -253,16 +253,3 @@ msgstr "Unités de stockage" #: model:ir.model.constraint,message:product_harmonized_system.constraint_hs_code_local_code_company_uniq msgid "This code already exists for this company !" msgstr "Ce code existe déjà pour cette société !" - -#~ msgid "" -#~ "Code used for the national Import/Export declaration. e.g. Intrastat for " -#~ "the European Union" -#~ msgstr "" -#~ "Code utilisé pour la déclaration nationale d'import/export, par exemple " -#~ "la DEB pour la France" - -#~ msgid "HS Code" -#~ msgstr "Code S.H." - -#~ msgid "HS Codes" -#~ msgstr "Codes S.H." diff --git a/product_harmonized_system/migrations/14.0.2.0.0/post-migration.py b/product_harmonized_system/migrations/14.0.2.0.0/post-migration.py deleted file mode 100644 index 2319cf2..0000000 --- a/product_harmonized_system/migrations/14.0.2.0.0/post-migration.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2021 Akretion France (http://www.akretion.com/) -# @author: Alexis de Lattre -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import SUPERUSER_ID, api - - -def migrate(cr, version): - if not version: - return - - with api.Environment.manage(): - env = api.Environment(cr, SUPERUSER_ID, {}) - pc_field_id = env.ref( - "product_harmonized_system.field_product_category__hs_code_id" - ).id - cr.execute( - """ - UPDATE product_category pc - SET hs_code_id=SUBSTRING(ip.value_reference, 9, 99)::int - FROM ir_property ip - WHERE ip.res_id like 'product.category,%%' AND - SUBSTRING(ip.res_id, 18, 99)::int=pc.id AND - ip.name='hs_code_id' AND - ip.value_reference IS NOT null AND - ip.fields_id=%s - """, - (pc_field_id,), - ) - pt_field_id = env.ref( - "product_harmonized_system.field_product_template__hs_code_id" - ).id - cr.execute( - """ - UPDATE product_template pt - SET hs_code_id=SUBSTRING(ip.value_reference, 9, 99)::int - FROM ir_property ip - WHERE ip.res_id like 'product.template,%%' AND - SUBSTRING(ip.res_id, 18, 99)::int=pt.id AND - ip.name='hs_code_id' AND - ip.value_reference IS NOT null AND - ip.fields_id=%s - """, - (pt_field_id,), - ) diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index da8cf11..89c1000 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -4,6 +4,8 @@ # @author Luc de Meyer # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from textwrap import shorten + from odoo import api, fields, models @@ -81,7 +83,7 @@ class HSCode(models.Model): name = this.local_code if this.description: name += " " + this.description - name = len(name) > 55 and name[:55] + "..." or name + name = shorten(name, 55) res.append((this.id, name)) return res diff --git a/product_harmonized_system/models/product_category.py b/product_harmonized_system/models/product_category.py index 89d10a3..e9d9750 100644 --- a/product_harmonized_system/models/product_category.py +++ b/product_harmonized_system/models/product_category.py @@ -13,9 +13,6 @@ class ProductCategory(models.Model): hs_code_id = fields.Many2one( "hs.code", string="H.S. Code", - # company_dependent updated from True to False in 14.0.2.0.0 - # migration scripts provided - company_dependent=False, ondelete="restrict", help="Harmonised System Code. If this code is not " "set on the product itself, it will be read here, on the " diff --git a/product_harmonized_system/models/product_template.py b/product_harmonized_system/models/product_template.py index 902deea..7aa950d 100644 --- a/product_harmonized_system/models/product_template.py +++ b/product_harmonized_system/models/product_template.py @@ -13,9 +13,6 @@ class ProductTemplate(models.Model): hs_code_id = fields.Many2one( "hs.code", string="H.S. Code", - # company_dependent updated from True to False in 14.0.2.0.0 - # migration scripts provided - company_dependent=False, ondelete="restrict", help="Harmonised System Code. Nomenclature is " "available from the World Customs Organisation, see " diff --git a/product_harmonized_system/static/description/index.html b/product_harmonized_system/static/description/index.html index 53a2502..52390f9 100644 --- a/product_harmonized_system/static/description/index.html +++ b/product_harmonized_system/static/description/index.html @@ -3,7 +3,7 @@ - + Product Harmonized System Codes