diff --git a/product_harmonized_system/models/hs_code.py b/product_harmonized_system/models/hs_code.py index 245cb3d..da8cf11 100644 --- a/product_harmonized_system/models/hs_code.py +++ b/product_harmonized_system/models/hs_code.py @@ -53,7 +53,7 @@ class HSCode(models.Model): @api.model def _default_company_id(self): - return self.env.company + return False @api.depends("local_code") def _compute_hs_code(self): diff --git a/product_harmonized_system/views/product_template.xml b/product_harmonized_system/views/product_template.xml index 8cdfd2e..59fa83e 100644 --- a/product_harmonized_system/views/product_template.xml +++ b/product_harmonized_system/views/product_template.xml @@ -23,4 +23,17 @@ + + product.template + + + + + + + diff --git a/product_harmonized_system_delivery/models/product.py b/product_harmonized_system_delivery/models/product.py index 5b65cf2..eab6887 100644 --- a/product_harmonized_system_delivery/models/product.py +++ b/product_harmonized_system_delivery/models/product.py @@ -7,5 +7,4 @@ from odoo import fields, models class ProductTemplate(models.Model): _inherit = "product.template" - # this field cannot be stored because hs_code_id is company dependent - hs_code = fields.Char(related="hs_code_id.hs_code", readonly=True, store=False) + hs_code = fields.Char(related="hs_code_id.hs_code", store=True)