Skip to content

Commit 64b9676

Browse files
[IMP] product_harmonized_system: Remove company_id
TT55417
1 parent 73ecac4 commit 64b9676

8 files changed

Lines changed: 20 additions & 39 deletions

File tree

product_harmonized_system/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Contributors
7979
* Alexis de Lattre, Akretion <alexis.delattre@akretion.com>
8080
* Luc De Meyer, Noviat <info@noviat.com>
8181
* Kumar Aberer, brain-tec AG <kumar.aberer@braintec-group.com>
82+
* Juan Carlos Oñate, Tecnativa <juancarlos.onate@tecnativa.com>
8283

8384
Maintainers
8485
~~~~~~~~~~~

product_harmonized_system/__manifest__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
{
1212
"name": "Product Harmonized System Codes",
13-
"version": "16.0.1.1.0",
13+
"version": "16.0.2.0.0",
1414
"category": "Reporting",
1515
"license": "AGPL-3",
1616
"summary": "Base module for Product Import/Export reports",
@@ -20,7 +20,6 @@
2020
"depends": ["product"],
2121
"excludes": ["account_intrastat"],
2222
"data": [
23-
"security/product_hs_security.xml",
2423
"security/ir.model.access.csv",
2524
"views/hs_code.xml",
2625
"views/product_category.xml",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from openupgradelib import openupgrade
2+
3+
4+
@openupgrade.migrate()
5+
def migrate(env, version):
6+
openupgrade.rename_columns(env.cr, {"hs_code": [("company_id", None)]})
7+
rule = env.ref("product_harmonized_system.hs_code_company_rule")
8+
if rule:
9+
rule.unlink()

product_harmonized_system/models/hs_code.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ class HSCode(models.Model):
3434
"has a few additional digits to extend the H.S. code.",
3535
)
3636
active = fields.Boolean(default=True)
37-
company_id = fields.Many2one(
38-
"res.company",
39-
string="Company",
40-
default=lambda self: self._default_company_id(),
41-
)
4237
product_categ_ids = fields.One2many(
4338
comodel_name="product.category",
4439
inverse_name="hs_code_id",
@@ -54,10 +49,6 @@ class HSCode(models.Model):
5449
product_categ_count = fields.Integer(compute="_compute_product_categ_count")
5550
product_tmpl_count = fields.Integer(compute="_compute_product_tmpl_count")
5651

57-
@api.model
58-
def _default_company_id(self):
59-
return False
60-
6152
@api.depends("local_code")
6253
def _compute_hs_code(self):
6354
for this in self:
@@ -92,14 +83,6 @@ def name_get(self):
9283
res.append((this.id, name))
9384
return res
9485

95-
_sql_constraints = [
96-
(
97-
"local_code_company_uniq",
98-
"unique(local_code, company_id)",
99-
"This code already exists for this company !",
100-
)
101-
]
102-
10386
@api.model_create_multi
10487
def create(self, vals_list):
10588
for vals in vals_list:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* Alexis de Lattre, Akretion <alexis.delattre@akretion.com>
22
* Luc De Meyer, Noviat <info@noviat.com>
33
* Kumar Aberer, brain-tec AG <kumar.aberer@braintec-group.com>
4+
* Juan Carlos Oñate, Tecnativa <juancarlos.onate@tecnativa.com>

product_harmonized_system/security/product_hs_security.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

product_harmonized_system/static/description/index.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger (goodger@python.org)
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -420,12 +421,15 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
420421
<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>
421422
<li>Luc De Meyer, Noviat &lt;<a class="reference external" href="mailto:info&#64;noviat.com">info&#64;noviat.com</a>&gt;</li>
422423
<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>
424+
<li>Juan Carlos Oñate, Tecnativa &lt;<a class="reference external" href="mailto:juancarlos.onate&#64;tecnativa.com">juancarlos.onate&#64;tecnativa.com</a>&gt;</li>
423425
</ul>
424426
</div>
425427
<div class="section" id="maintainers">
426428
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
427429
<p>This module is maintained by the OCA.</p>
428-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
430+
<a class="reference external image-reference" href="https://odoo-community.org">
431+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
432+
</a>
429433
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
430434
mission is to support the collaborative development of Odoo features and
431435
promote its widespread use.</p>

product_harmonized_system/views/hs_code.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@
3232
<field name="hs_code" />
3333
<field name="local_code" />
3434
<field name="description" optional="show" />
35-
<field
36-
name="company_id"
37-
groups="base.group_multi_company"
38-
optional="show"
39-
/>
4035
</tree>
4136
</field>
4237
</record>
@@ -99,7 +94,6 @@
9994
<field name="local_code" />
10095
<field name="hs_code" />
10196
<field name="description" />
102-
<field name="company_id" groups="base.group_multi_company" />
10397
</group>
10498
</sheet>
10599
</form>

0 commit comments

Comments
 (0)