mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
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:
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user