[MIG] product_harmonized_system: Migration to 17.0

This commit is contained in:
Andreu Orensanz
2024-03-11 16:20:52 +01:00
committed by Lukas Tran
parent e8b843d065
commit 4595ccb34c
8 changed files with 26 additions and 30 deletions

View File

@@ -7,7 +7,7 @@ Product Harmonized System Codes
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:afd00899a20aac3c96a9b21fbcfc0c4a66f1617290ff92124a6b6987e5d9c975
!! source digest: sha256:0cd16bb6b2c05a94c0dda271e92e0ceb3bd726d25244ee9d5eac2cb562c0d99e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png

View File

@@ -10,7 +10,7 @@
{
"name": "Product Harmonized System Codes",
"version": "16.0.1.1.0",
"version": "17.0.1.0.0",
"category": "Reporting",
"license": "AGPL-3",
"summary": "Base module for Product Import/Export reports",

View File

@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -55,6 +55,7 @@ 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
#: model_terms:ir.ui.view,arch_db:product_harmonized_system.product_template_search_view
msgid "Country of Origin"
msgstr ""
@@ -132,11 +133,6 @@ msgstr ""
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"

View File

@@ -65,32 +65,30 @@ class HSCode(models.Model):
@api.depends("product_categ_ids")
def _compute_product_categ_count(self):
rg_res = self.env["product.category"].read_group(
[("hs_code_id", "in", self.ids)], ["hs_code_id"], ["hs_code_id"]
rg_res = self.env["product.category"]._read_group(
[("hs_code_id", "in", self.ids)], ["hs_code_id"], ["id:count"]
)
mapped_data = {x["hs_code_id"][0]: x["hs_code_id_count"] for x in rg_res}
mapped_data = {rec.id: count for (rec, count) in rg_res}
for code in self:
code.product_categ_count = mapped_data.get(code.id, 0)
@api.depends("product_tmpl_ids")
def _compute_product_tmpl_count(self):
rg_res = self.env["product.template"].read_group(
[("hs_code_id", "in", self.ids)], ["hs_code_id"], ["hs_code_id"]
rg_res = self.env["product.template"]._read_group(
[("hs_code_id", "in", self.ids)], ["hs_code_id"], ["id:count"]
)
mapped_data = {x["hs_code_id"][0]: x["hs_code_id_count"] for x in rg_res}
mapped_data = {rec.id: count for (rec, count) in rg_res}
for code in self:
code.product_tmpl_count = mapped_data.get(code.id, 0)
@api.depends("local_code", "description")
def name_get(self):
res = []
def _compute_display_name(self):
for this in self:
name = this.local_code
if this.description:
name += " " + this.description
name = shorten(name, 55)
res.append((this.id, name))
return res
this.display_name = name
_sql_constraints = [
(

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">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
@@ -367,7 +366,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:afd00899a20aac3c96a9b21fbcfc0c4a66f1617290ff92124a6b6987e5d9c975
!! source digest: sha256:0cd16bb6b2c05a94c0dda271e92e0ceb3bd726d25244ee9d5eac2cb562c0d99e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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"><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"><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>This module contains the objects for Harmonised System Codes (H.S.

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2010-2021 Akretion France (http://www.akretion.com/)
Copyright 2010-2024 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).
-->
@@ -65,7 +65,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<div class="oe_button_box" name="button_box">
<button

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2010-2022 Akretion (http://www.akretion.com/)
Copyright 2010-2024 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).
-->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2010-2022 Akretion France (http://www.akretion.com/)
Copyright 2010-2024 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).
-->
@@ -11,19 +11,17 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<group name="group_standard_price" position="inside">
<field
name="hs_code_id"
attrs="{'invisible': [('type', '=', 'service')]}"
/>
<group name="group_general" position="inside">
<field name="hs_code_id" invisible="type == 'service'" />
<field
name="origin_country_id"
attrs="{'invisible': [('type', '=', 'service')]}"
invisible="type == 'service'"
options="{'no_create': True}"
/>
</group>
</field>
</record>
<record id="product_template_search_view" model="ir.ui.view">
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view" />
@@ -34,6 +32,11 @@
name="hs_code_groupby"
context="{'group_by': 'hs_code_id'}"
/>
<filter
string="Country of Origin"
name="origin_country_groupby"
context="{'group_by': 'origin_country_id'}"
/>
</filter>
</field>
</record>