Skip to content

Commit 48dbf10

Browse files
[IMP] product_harmonized_system: Remove company_id
TT55417
1 parent 21c6f4b commit 48dbf10

File tree

5 files changed

+14
-25
lines changed

5 files changed

+14
-25
lines changed

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": "18.0.1.2.0",
13+
"version": "18.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
@@ -41,11 +41,6 @@ class HSCode(models.Model):
4141
"has a few additional digits to extend the H.S. code.",
4242
)
4343
active = fields.Boolean(default=True)
44-
company_id = fields.Many2one(
45-
"res.company",
46-
string="Company",
47-
default=lambda self: self._default_company_id(),
48-
)
4944
product_categ_ids = fields.One2many(
5045
comodel_name="product.category",
5146
inverse_name="hs_code_id",
@@ -61,10 +56,6 @@ class HSCode(models.Model):
6156
product_categ_count = fields.Integer(compute="_compute_product_categ_count")
6257
product_tmpl_count = fields.Integer(compute="_compute_product_tmpl_count")
6358

64-
@api.model
65-
def _default_company_id(self):
66-
return False
67-
6859
@api.depends("local_code")
6960
def _compute_hs_code(self):
7061
for this in self:
@@ -97,14 +88,6 @@ def _compute_display_name(self):
9788
name = shorten(name, 55)
9889
this.display_name = name
9990

100-
_sql_constraints = [
101-
(
102-
"local_code_company_uniq",
103-
"unique(local_code, company_id)",
104-
"This code already exists for this company !",
105-
)
106-
]
107-
10891
@api.model_create_multi
10992
def create(self, vals_list):
11093
for vals in vals_list:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* Alexis de Lattre, Akretion <alexis.delattre@akretion.com>
2+
* Luc De Meyer, Noviat <info@noviat.com>
3+
* Kumar Aberer, brain-tec AG <kumar.aberer@braintec-group.com>
4+
* Juan Carlos Oñate, Tecnativa <juancarlos.onate@tecnativa.com>

product_harmonized_system/views/hs_code.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
<field name="local_code" />
3434
<field name="description" optional="show" />
3535
<field name="long_description" optional="hide" />
36-
<field
37-
name="company_id"
38-
groups="base.group_multi_company"
39-
optional="show"
40-
/>
4136
</list>
4237
</field>
4338
</record>
@@ -101,7 +96,6 @@
10196
<field name="hs_code" />
10297
<field name="description" />
10398
<field name="long_description" />
104-
<field name="company_id" groups="base.group_multi_company" />
10599
</group>
106100
</sheet>
107101
</form>

0 commit comments

Comments
 (0)