Skip to content

Commit

Permalink
[MIG] product_harmonized_system_delivery: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreuOForgeFlow committed Mar 18, 2024
1 parent 972512b commit 1e78f27
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 deletions.
15 changes: 8 additions & 7 deletions product_harmonized_system_delivery/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ Product Harmonized System Codes - Delivery

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

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

**Table of contents**

Expand Down
4 changes: 2 additions & 2 deletions product_harmonized_system_delivery/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

{
"name": "Product Harmonized System Codes - Delivery",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Reporting",
"license": "AGPL-3",
"summary": "Hide native hs_code field provided by the delivery module",
"author": "Akretion, Odoo Community Association (OCA)",
"maintainers": ["alexis-via", "luc-demeyer"],
"website": "https://github.com/OCA/intrastat-extrastat",
"depends": ["delivery", "product_harmonized_system"],
"depends": ["stock_delivery", "product_harmonized_system"],
"data": ["views/product_template.xml"],
"installable": True,
"auto_install": True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
class ProductTemplate(models.Model):
_inherit = "product.template"

# IMPORTANT: Overwrites two Odoo standard fields
hs_code = fields.Char(related="hs_code_id.hs_code", store=True)
country_of_origin = fields.Many2one(related="origin_country_id", store=True)
8 changes: 4 additions & 4 deletions product_harmonized_system_delivery/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
The OCA module *product_harmonized_system* adds a many2one field
*hs_code_id* on product templates that points to an *H.S. Code* object.
But the *delivery* module from the official addons adds a char field
But the *stock_delivery* module from the official addons adds a char field
*hs_code* on product templates, which has the same purpose, but we can't
use it because we need structured data for H.S. codes. This module hides
the *hs_code* field added by the *delivery* module, to avoid confusion.
the *hs_code* field added by the *stock_delivery* module, to avoid confusion.

Since Odoo v16, the *delivery* module also adds a many2one field
Since Odoo v16, the *stock_delivery* module also adds a many2one field
*country_of_origin*, which is similar to the many2one field
*origin_country_id* of the OCA module *product_harmonized_system*. This
module also hides the *country_of_origin* field added by the *delivery*
module also hides the *country_of_origin* field added by the *stock_delivery*
module.
16 changes: 8 additions & 8 deletions product_harmonized_system_delivery/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?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>
Expand Down Expand Up @@ -372,15 +371,16 @@ <h1 class="title">Product Harmonized System Codes - Delivery</h1>
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/intrastat-extrastat/tree/17.0/product_harmonized_system_delivery"><img alt="OCA/intrastat-extrastat" src="https://img.shields.io/badge/github-OCA%2Fintrastat--extrastat-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/intrastat-extrastat-17-0/intrastat-extrastat-17-0-product_harmonized_system_delivery"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/intrastat-extrastat&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>The OCA module <em>product_harmonized_system</em> adds a many2one field
<em>hs_code_id</em> on product templates that points to an <em>H.S. Code</em> object.
But the <em>delivery</em> module from the official addons adds a char field
<em>hs_code</em> on product templates, which has the same purpose, but we can’t
use it because we need structured data for H.S. codes. This module hides
the <em>hs_code</em> field added by the <em>delivery</em> module, to avoid confusion.</p>
<p>Since Odoo v16, the <em>delivery</em> module also adds a many2one field
But the <em>stock_delivery</em> module from the official addons adds a char
field <em>hs_code</em> on product templates, which has the same purpose, but we
can’t use it because we need structured data for H.S. codes. This module
hides the <em>hs_code</em> field added by the <em>stock_delivery</em> module, to avoid
confusion.</p>
<p>Since Odoo v16, the <em>stock_delivery</em> module also adds a many2one field
<em>country_of_origin</em>, which is similar to the many2one field
<em>origin_country_id</em> of the OCA module <em>product_harmonized_system</em>. This
module also hides the <em>country_of_origin</em> field added by the <em>delivery</em>
module.</p>
module also hides the <em>country_of_origin</em> field added by the
<em>stock_delivery</em> module.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<record id="product_template_hs_code" model="ir.ui.view">
<field name="name">hide_native_hs_code_field.product.template.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="delivery.product_template_hs_code" />
<field name="inherit_id" ref="stock_delivery.product_template_hs_code" />
<field name="arch" type="xml">
<field name="hs_code" position="attributes">
<attribute name="invisible">1</attribute>
Expand Down

0 comments on commit 1e78f27

Please sign in to comment.