[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
This commit is contained in:
BenjaHe
2019-12-19 09:18:09 +01:00
committed by Luc De Meyer
parent daf7f86484
commit 10d9ca506a
22 changed files with 1653 additions and 0 deletions

View File

@@ -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/12.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-12-0/intrastat-extrastat-12-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/12.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 <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**
.. 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 <https://github.com/OCA/intrastat-extrastat/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 <https://github.com/OCA/intrastat-extrastat/issues/new?body=module:%20product_harmonized_system%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* brain-tec AG
* Akretion
* Noviat
Contributors
~~~~~~~~~~~~
* Alexis de Lattre, Akretion <alexis.delattre@akretion.com>
* Luc De Meyer, Noviat <info@noviat.com>
* Kumar Aberer, brain-tec AG <kumar.aberer@braintec-group.com>
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 <https://github.com/OCA/intrastat-extrastat/tree/12.0/product_harmonized_system>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -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 <info@noviat.com>
# @author Kumar Aberer <kumar.aberer@braintec-group.com>
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# @author Luc de Meyer <info@noviat.com>
# 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,
}

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2011-2019 Akretion France (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<record id="84715000" model="hs.code">
<field name="local_code">84715000</field>
<field name="description">Automatic data-processing machines (computers)</field>
</record>
<record id="84717050" model="hs.code">
<field name="local_code">84717050</field>
<field name="description">Storage units</field>
</record>
<record id="85340090" model="hs.code">
<field name="local_code">85340090</field>
<field name="description">Printed circuits</field>
</record>
<record id="product.product_product_3" model="product.product">
<field name="hs_code_id" ref="84715000" />
<field name="origin_country_id" ref="base.tw" />
<field name="weight">8.7</field>
</record>
<record id="product.product_product_4" model="product.product">
<field name="hs_code_id" ref="84715000" />
<field name="origin_country_id" ref="base.cn" />
<field name="weight">1.1</field>
</record>
<record id="product.product_product_5" model="product.product">
<field name="hs_code_id" ref="84715000" />
<field name="origin_country_id" ref="base.cn" />
<field name="weight">8.2</field>
</record>
<record id="product.product_product_13" model="product.product">
<field name="hs_code_id" ref="84717050" />
<field name="origin_country_id" ref="base.sg" />
<field name="weight">0.01</field>
</record>
<record id="product.product_product_16" model="product.product">
<field name="hs_code_id" ref="84717050" />
<field name="origin_country_id" ref="base.sg" />
<field name="weight">0.67</field>
</record>
<record id="product.product_product_20" model="product.product">
<field name="hs_code_id" ref="85340090" />
<field name="origin_country_id" ref="base.tw" />
<field name="weight">1.05</field>
</record>
<record id="product.product_product_22" model="product.product">
<field name="hs_code_id" ref="85340090" />
<field name="origin_country_id" ref="base.tw" />
<field name="weight">0.3</field>
</record>
<record id="product.product_product_25" model="product.product">
<field name="hs_code_id" ref="84715000" />
<field name="origin_country_id" ref="base.be" />
<field name="weight">3.3</field>
</record>
</odoo>

View File

@@ -0,0 +1,216 @@
# 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 <jvcsan@gmail.com>\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 "<span class=\"o_stat_text\"> Product Categs</span>"
msgstr "<span class=\"o_stat_text\"> Categs Producto</span>"
#. module: product_harmonized_system
#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form
msgid "<span class=\"o_stat_text\"> Products</span>"
msgstr "<span class=\"o_stat_text\"> Productos</span>"
#. 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
#: sql_constraint:hs.code:0
msgid "This code already exists for this company !"
msgstr "Este código ya existe para esta compañía !"

View File

@@ -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 "<span class=\"o_stat_text\"> Product Categs</span>"
msgstr ""
#. module: product_harmonized_system
#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form
msgid "<span class=\"o_stat_text\"> Products</span>"
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
#: sql_constraint:hs.code:0
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."

View File

@@ -0,0 +1,206 @@
# 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"
"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 "<span class=\"o_stat_text\"> Product Categs</span>"
msgstr ""
#. module: product_harmonized_system
#: model_terms:ir.ui.view,arch_db:product_harmonized_system.hs_code_view_form
msgid "<span class=\"o_stat_text\"> Products</span>"
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
#: sql_constraint:hs.code:0
msgid "This code already exists for this company !"
msgstr ""

View File

@@ -0,0 +1,3 @@
from . import hs_code
from . import product_category
from . import product_template

View File

@@ -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 <alexis.delattre@akretion.com>
# @author Luc de Meyer <info@noviat.com>
# 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)

View File

@@ -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 <alexis.delattre@akretion.com>
# @author Luc de Meyer <info@noviat.com>
# 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

View File

@@ -0,0 +1,41 @@
# Copyright 2011-2016 Akretion (http://www.akretion.com)
# Copyright 2009-2016 Noviat (http://www.noviat.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# @author Luc de Meyer <info@noviat.com>
# 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

View File

@@ -0,0 +1,3 @@
* Alexis de Lattre, Akretion <alexis.delattre@akretion.com>
* Luc De Meyer, Noviat <info@noviat.com>
* Kumar Aberer, brain-tec AG <kumar.aberer@braintec-group.com>

View File

@@ -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 <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.

View File

@@ -0,0 +1 @@
This module is NOT compatible with the *account_intrastat* module from Odoo Enterprise.

View File

@@ -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*).

View File

@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_hs_code_group_system Full access on hs.code to Settings group model_hs_code base.group_system 1 1 1 1
3 access_hs_code_read Read access on hs.code to everybody model_hs_code 1 0 0 0

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<record id="hs_code_company_rule" model="ir.rule">
<field name="name">HS Code Company rule</field>
<field name="model_id" ref="model_hs_code"/>
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
</record>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,437 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Product Harmonized System Codes</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="product-harmonized-system-codes">
<h1 class="title">Product Harmonized System Codes</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/intrastat-extrastat/tree/12.0/product_harmonized_system"><img alt="OCA/intrastat-extrastat" src="https://img.shields.io/badge/github-OCA%2Fintrastat--extrastat-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/intrastat-extrastat-12-0/intrastat-extrastat-12-0-product_harmonized_system"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/227/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module contains the objects for Harmonised System Codes (H.S. codes). The full nomenclature is available from the <cite>World Customs Organisation &lt;http://www.wcoomd.org/&gt;</cite>. These code are usually required on the Proforma invoices that are attached to the packages that are shipped abroad.</p>
<p>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.</p>
<p>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.</p>
<p>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 <em>intrastat_product</em> module.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#installation" id="id1">Installation</a></li>
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#id1">Installation</a></h1>
<p>This module is NOT compatible with the <em>account_intrastat</em> module from Odoo Enterprise.</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
<p>As this module only depends on the <em>product</em> module and that module doesnt 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 <em>product_harmonized_system_stock</em>.</p>
<p>Once the H.S. codes are created, you will be able to set the H.S. code on an product (under the <em>Information</em> tab) or on a product category. On the product form, you will also be able to set the <em>Country of Origin</em> of a product (for example, if the product is <em>made in China</em>, select <em>China</em> as <em>Country of Origin</em>).</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/intrastat-extrastat/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/intrastat-extrastat/issues/new?body=module:%20product_harmonized_system%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
<ul class="simple">
<li>brain-tec AG</li>
<li>Akretion</li>
<li>Noviat</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple">
<li>Alexis de Lattre, Akretion &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
<li>Luc De Meyer, Noviat &lt;<a class="reference external" href="mailto:info&#64;noviat.com">info&#64;noviat.com</a>&gt;</li>
<li>Kumar Aberer, brain-tec AG &lt;<a class="reference external" href="mailto:kumar.aberer&#64;braintec-group.com">kumar.aberer&#64;braintec-group.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/intrastat-extrastat/tree/12.0/product_harmonized_system">OCA/intrastat-extrastat</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010-2019 Akretion France (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- Search view for H.S. code -->
<record id="hs_code_view_search" model="ir.ui.view">
<field name="name">hs.code.search</field>
<field name="model">hs.code</field>
<field name="arch" type="xml">
<search string="Search H.S. Codes">
<field name="local_code"
filter_domain="['|', ('local_code', 'like', self), ('description', 'ilike', self)]"/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
</search>
</field>
</record>
<!-- Tree view for H.S. code -->
<record id="hs_code_view_tree" model="ir.ui.view">
<field name="name">hs.code.tree</field>
<field name="model">hs.code</field>
<field name="arch" type="xml">
<tree string="H.S. Codes">
<field name="hs_code"/>
<field name="local_code"/>
<field name="description"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<!-- Action used in the form view for HS codes -->
<record id="product_categ_hs_code_action" model="ir.actions.act_window">
<field name="name">Product Categories</field>
<field name="res_model">product.category</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('hs_code_id', '=', active_id)]</field>
</record>
<record id="product_template_hs_code_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.template</field>
<field name="view_mode">kanban,tree,form</field>
<field name="domain">[('hs_code_id', '=', active_id)]</field>
</record>
<!-- Form view for H.S. code -->
<record id="hs_code_view_form" model="ir.ui.view">
<field name="name">hs.code.form</field>
<field name="model">hs.code</field>
<field name="arch" type="xml">
<form string="H.S. Code">
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button"
name="%(product_categ_hs_code_action)d"
icon="fa-th-list"
type="action">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="product_categ_count"/></span>
<span class="o_stat_text"> Product Categs</span>
</div>
</button>
<button class="oe_stat_button"
name="%(product_template_hs_code_action)d"
icon="fa-th-list"
type="action">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="product_tmpl_count"/></span>
<span class="o_stat_text"> Products</span>
</div>
</button>
<button name="toggle_active" type="object"
class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button"
options='{"terminology": "archive"}'/>
</button>
</div>
<group name="main">
<field name="local_code" />
<field name="hs_code"/>
<field name="description"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</form>
</field>
</record>
<!-- Action for H.S. code -->
<record id="hs_code_action" model="ir.actions.act_window">
<field name="name">H.S. Codes</field>
<field name="res_model">hs.code</field>
<field name="view_mode">tree,form</field>
</record>
<!-- The menu entry for H.S. code is now provided by the module
product_harmonized_system_stock -->
</odoo>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010-2019 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- Product category form view -->
<record id="product_category_form_view" model="ir.ui.view">
<field name="name">hs_code.product.category.form</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='first']" position="after">
<group name="hs_code" string="Import/Export Properties" colspan="2">
<field name="hs_code_id"/>
</group>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2010-2019 Akretion France (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- product.template form view -->
<record id="product_template_form_view" model="ir.ui.view">
<field name="name">hs_code.product.template.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<field name="company_id" position="before">
<field name="hs_code_id" attrs="{'invisible': [('type', '=', 'service')]}"/>
<field name="origin_country_id" attrs="{'invisible': [('type', '=', 'service')]}"/>
</field>
</field>
</record>
</odoo>