[10.0][FIX]get_hs_code_recursively on product.template

This commit is contained in:
luc.demeyer@noviat.com
2018-08-20 08:55:18 +02:00
committed by Pedro M. Baeza
parent 30bffda00a
commit eba76446e4
2 changed files with 2 additions and 3 deletions

View File

@@ -82,5 +82,5 @@ class AccountInvoiceLine(models.Model):
@api.onchange('product_id')
def intrastat_product_id_change(self):
if self.product_id:
hs_code = self.product_id.product_tmpl_id.get_hs_code_recursively()
hs_code = self.product_id.get_hs_code_recursively()
self.hs_code_id = hs_code and hs_code.id or False

View File

@@ -512,8 +512,7 @@ class IntrastatProductDeclaration(models.Model):
if inv_line.hs_code_id:
hs_code = inv_line.hs_code_id
elif inv_line.product_id and self._is_product(inv_line):
hs_code = inv_line.product_id.product_tmpl_id.\
get_hs_code_recursively()
hs_code = inv_line.product_id.get_hs_code_recursively()
if not hs_code:
note = "\n" + _(
"Missing H.S. code on product %s. "