[MIG] product_harmonized_system_delivery: Migration to 17.0

This commit is contained in:
Andreu Orensanz
2024-03-15 12:31:06 +01:00
committed by Lukas Tran
parent b39b840c7a
commit 03e7bf5dc8
8 changed files with 31 additions and 27 deletions

View File

@@ -7,7 +7,7 @@ Product Harmonized System Codes - Delivery
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f732fa747f85d891f007e5fb0af1290c25ceeeaca0c6e7cc6a3140c8c3ae9127 !! source digest: sha256:b3a1334583e53e183ece0d674687456f1794c5afe45888a64e912a44564b504d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -30,16 +30,17 @@ Product Harmonized System Codes - Delivery
The OCA module *product_harmonized_system* adds a many2one field The OCA module *product_harmonized_system* adds a many2one field
*hs_code_id* on product templates that points to an *H.S. Code* object. *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
*hs_code* on product templates, which has the same purpose, but we can't field *hs_code* on product templates, which has the same purpose, but we
use it because we need structured data for H.S. codes. This module hides can't use it because we need structured data for H.S. codes. This module
the *hs_code* field added by the *delivery* module, to avoid confusion. 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 *country_of_origin*, which is similar to the many2one field
*origin_country_id* of the OCA module *product_harmonized_system*. This *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
module. *stock_delivery* module.
**Table of contents** **Table of contents**

View File

@@ -4,14 +4,14 @@
{ {
"name": "Product Harmonized System Codes - Delivery", "name": "Product Harmonized System Codes - Delivery",
"version": "16.0.1.0.0", "version": "17.0.1.0.0",
"category": "Reporting", "category": "Reporting",
"license": "AGPL-3", "license": "AGPL-3",
"summary": "Hide native hs_code field provided by the delivery module", "summary": "Hide native hs_code field provided by the delivery module",
"author": "Akretion, Odoo Community Association (OCA)", "author": "Akretion, Odoo Community Association (OCA)",
"maintainers": ["alexis-via", "luc-demeyer"], "maintainers": ["alexis-via", "luc-demeyer"],
"website": "https://github.com/OCA/intrastat-extrastat", "website": "https://github.com/OCA/intrastat-extrastat",
"depends": ["delivery", "product_harmonized_system"], "depends": ["stock_delivery", "product_harmonized_system"],
"data": ["views/product_template.xml"], "data": ["views/product_template.xml"],
"installable": True, "installable": True,
"auto_install": True, "auto_install": True,

View File

@@ -37,8 +37,10 @@ msgstr "Prodotto"
#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__country_of_origin #: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_product__country_of_origin
#: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__country_of_origin #: model:ir.model.fields,help:product_harmonized_system_delivery.field_product_template__country_of_origin
msgid "" msgid ""
"Rules of origin determine where goods originate, i.e. not where they have been shipped from, but where they have been produced or manufactured.\n" "Rules of origin determine where goods originate, i.e. not where they have "
"As such, the origin is the 'economic nationality' of goods traded in commerce." "been shipped from, but where they have been produced or manufactured.\n"
"As such, the origin is the 'economic nationality' of goods traded in "
"commerce."
msgstr "" msgstr ""
"Le regole dell'origine definiscono da dove si origina la merce, i.e. non da " "Le regole dell'origine definiscono da dove si origina la merce, i.e. non da "
"dove è stata spedita ma dove è stata prodotta o lavorata.\n" "dove è stata spedita ma dove è stata prodotta o lavorata.\n"

View File

@@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 16.0\n" "Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"

View File

@@ -7,5 +7,6 @@ from odoo import fields, models
class ProductTemplate(models.Model): class ProductTemplate(models.Model):
_inherit = "product.template" _inherit = "product.template"
# IMPORTANT: Overwrites two Odoo standard fields
hs_code = fields.Char(related="hs_code_id.hs_code", store=True) hs_code = fields.Char(related="hs_code_id.hs_code", store=True)
country_of_origin = fields.Many2one(related="origin_country_id", store=True) country_of_origin = fields.Many2one(related="origin_country_id", store=True)

View File

@@ -1,12 +1,12 @@
The OCA module *product_harmonized_system* adds a many2one field The OCA module *product_harmonized_system* adds a many2one field
*hs_code_id* on product templates that points to an *H.S. Code* object. *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 *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 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 *country_of_origin*, which is similar to the many2one field
*origin_country_id* of the OCA module *product_harmonized_system*. This *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. module.

View File

@@ -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"> <!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"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
@@ -367,20 +366,21 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f732fa747f85d891f007e5fb0af1290c25ceeeaca0c6e7cc6a3140c8c3ae9127 !! source digest: sha256:b3a1334583e53e183ece0d674687456f1794c5afe45888a64e912a44564b504d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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><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 <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. <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 But the <em>stock_delivery</em> module from the official addons adds a char
<em>hs_code</em> on product templates, which has the same purpose, but we cant field <em>hs_code</em> on product templates, which has the same purpose, but we
use it because we need structured data for H.S. codes. This module hides cant use it because we need structured data for H.S. codes. This module
the <em>hs_code</em> field added by the <em>delivery</em> module, to avoid confusion.</p> hides the <em>hs_code</em> field added by the <em>stock_delivery</em> module, to avoid
<p>Since Odoo v16, the <em>delivery</em> module also adds a many2one field 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>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 <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 also hides the <em>country_of_origin</em> field added by the
module.</p> <em>stock_delivery</em> module.</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
<ul class="simple"> <ul class="simple">

View File

@@ -9,7 +9,7 @@
<record id="product_template_hs_code" model="ir.ui.view"> <record id="product_template_hs_code" model="ir.ui.view">
<field name="name">hide_native_hs_code_field.product.template.form</field> <field name="name">hide_native_hs_code_field.product.template.form</field>
<field name="model">product.template</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="arch" type="xml">
<field name="hs_code" position="attributes"> <field name="hs_code" position="attributes">
<attribute name="invisible">1</attribute> <attribute name="invisible">1</attribute>