Skip to content

Commit

Permalink
[MIG] product_harmonized_system to v15
Browse files Browse the repository at this point in the history
TT36971
  • Loading branch information
alexis-via authored and victoralmau committed Aug 2, 2022
1 parent c704683 commit e4d819e
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 90 deletions.
10 changes: 5 additions & 5 deletions product_harmonized_system/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down Expand Up @@ -56,7 +56,7 @@ 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:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/intrastat-extrastat/issues/new?body=module:%20product_harmonized_system%0Aversion:%2015.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.

Expand Down Expand Up @@ -101,6 +101,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via| |maintainer-luc-demeyer|

This module is part of the `OCA/intrastat-extrastat <https://github.com/OCA/intrastat-extrastat/tree/14.0/product_harmonized_system>`_ project on GitHub.
This module is part of the `OCA/intrastat-extrastat <https://github.com/OCA/intrastat-extrastat/tree/15.0/product_harmonized_system>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 2 additions & 1 deletion product_harmonized_system/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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 <info@noviat.com>
# @author Kumar Aberer <kumar.aberer@braintec-group.com>
# @author Alexis de Lattre <alexis.delattre@akretion.com>
Expand All @@ -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",
Expand Down
6 changes: 0 additions & 6 deletions product_harmonized_system/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<span class=\"o_stat_text\"> Product Categs</span>"
#~ msgstr "<span class=\"o_stat_text\"> Categs Producto</span>"

#~ msgid "<span class=\"o_stat_text\"> Products</span>"
#~ msgstr "<span class=\"o_stat_text\"> Productos</span>"
13 changes: 0 additions & 13 deletions product_harmonized_system/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -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."
45 changes: 0 additions & 45 deletions product_harmonized_system/migrations/14.0.2.0.0/post-migration.py

This file was deleted.

10 changes: 4 additions & 6 deletions product_harmonized_system/models/hs_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# @author Luc de Meyer <info@noviat.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from textwrap import shorten

from odoo import api, fields, models


Expand Down Expand Up @@ -34,7 +36,7 @@ class HSCode(models.Model):
company_id = fields.Many2one(
"res.company",
string="Company",
default=lambda self: self._default_company_id(),
default=lambda self: self.env.company.id,
)
product_categ_ids = fields.One2many(
comodel_name="product.category",
Expand All @@ -51,10 +53,6 @@ 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 False

@api.depends("local_code")
def _compute_hs_code(self):
for this in self:
Expand All @@ -81,7 +79,7 @@ def name_get(self):
name = this.local_code
if this.description:
name += " " + this.description
name = len(name) > 55 and name[:55] + "..." or name
name = shorten(name, 55)
res.append((this.id, name))
return res

Expand Down
3 changes: 0 additions & 3 deletions product_harmonized_system/models/product_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
3 changes: 0 additions & 3 deletions product_harmonized_system/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
8 changes: 4 additions & 4 deletions product_harmonized_system/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Product Harmonized System Codes</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <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/14.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-14-0/intrastat-extrastat-14-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/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<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/15.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-15-0/intrastat-extrastat-15-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/15.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 codes are usually required on the Proforma invoices that are attached to the packages that are shipped abroad.</p>
<p>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.</p>
<p>You will also be able to configure the <em>country of origin</em> of a product, which is often required on the proforma invoice for the customs.</p>
Expand Down Expand Up @@ -400,7 +400,7 @@ <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:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/intrastat-extrastat/issues/new?body=module:%20product_harmonized_system%0Aversion:%2015.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">
Expand Down Expand Up @@ -430,7 +430,7 @@ <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external" href="https://github.com/alexis-via"><img alt="alexis-via" src="https://github.com/alexis-via.png?size=40px" /></a> <a class="reference external" href="https://github.com/luc-demeyer"><img alt="luc-demeyer" src="https://github.com/luc-demeyer.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/intrastat-extrastat/tree/14.0/product_harmonized_system">OCA/intrastat-extrastat</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/intrastat-extrastat/tree/15.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>
Expand Down
8 changes: 4 additions & 4 deletions product_harmonized_system/views/hs_code.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2010-2020 Akretion France (http://www.akretion.com/)
Copyright 2010-2021 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).
-->
Expand All @@ -10,7 +10,7 @@
<field name="name">hs.code.search</field>
<field name="model">hs.code</field>
<field name="arch" type="xml">
<search string="Search H.S. Codes">
<search>
<field
name="local_code"
filter_domain="['|', ('local_code', 'like', self), ('description', 'ilike', self)]"
Expand All @@ -28,7 +28,7 @@
<field name="name">hs.code.tree</field>
<field name="model">hs.code</field>
<field name="arch" type="xml">
<tree string="H.S. Codes">
<tree>
<field name="hs_code" />
<field name="local_code" />
<field name="description" />
Expand All @@ -54,7 +54,7 @@
<field name="name">hs.code.form</field>
<field name="model">hs.code</field>
<field name="arch" type="xml">
<form string="H.S. Code">
<form>
<sheet>
<field name="active" invisible="1" />
<widget
Expand Down

0 comments on commit e4d819e

Please sign in to comment.