mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
[13.0][FIX]replace deprecated _company_default_get
This commit is contained in:
committed by
Alexis de Lattre
parent
6aa93db78f
commit
09c2717e44
@@ -36,7 +36,7 @@ class HSCode(models.Model):
|
|||||||
string="Company",
|
string="Company",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
required=True,
|
required=True,
|
||||||
default=lambda self: self.env["res.company"]._company_default_get(),
|
default=lambda self: self._default_company_id(),
|
||||||
)
|
)
|
||||||
product_categ_ids = fields.One2many(
|
product_categ_ids = fields.One2many(
|
||||||
comodel_name="product.category",
|
comodel_name="product.category",
|
||||||
@@ -53,6 +53,10 @@ class HSCode(models.Model):
|
|||||||
product_categ_count = fields.Integer(compute="_compute_product_categ_count")
|
product_categ_count = fields.Integer(compute="_compute_product_categ_count")
|
||||||
product_tmpl_count = fields.Integer(compute="_compute_product_tmpl_count")
|
product_tmpl_count = fields.Integer(compute="_compute_product_tmpl_count")
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _default_company_id(self):
|
||||||
|
return self.env.company
|
||||||
|
|
||||||
@api.depends("local_code")
|
@api.depends("local_code")
|
||||||
def _compute_hs_code(self):
|
def _compute_hs_code(self):
|
||||||
for this in self:
|
for this in self:
|
||||||
|
|||||||
Reference in New Issue
Block a user