Merge pull request #21 from akretion/8.0-get-hs-code-on-product

[REF] getting hs code should be done on the product.product
This commit is contained in:
beau sebastien
2017-08-10 17:46:30 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -121,7 +121,7 @@ class AccountInvoiceLine(models.Model):
if product:
product = self.env['product.product'].browse(product)
hs_code = product.product_tmpl_id.get_hs_code_recursively()
hs_code = product.get_hs_code_recursively()
if hs_code:
res['value']['hs_code_id'] = hs_code.id
else:

View File

@@ -39,6 +39,10 @@ class ProductTemplate(models.Model):
help="Country of origin of the product i.e. product "
"'made in ____'.")
class ProductProduct(models.Model):
_inherit = 'product.product'
@api.multi
def get_hs_code_recursively(self):
self.ensure_one()