mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
fix traceback when no product on invoice line
This commit is contained in:
@@ -529,6 +529,15 @@ class IntrastatProductDeclaration(models.Model):
|
||||
|
||||
if inv_line.hs_code_id:
|
||||
hs_code = inv_line.hs_code_id
|
||||
if not inv_line.product_id:
|
||||
note = "\n" + _(
|
||||
"Missing product on invoice line with H.S. code %s "
|
||||
"in invoice %s.") % (
|
||||
hs_code,
|
||||
inv_line.invoice_id.number)
|
||||
self._note += note
|
||||
continue
|
||||
|
||||
elif inv_line.product_id and self._is_product(inv_line):
|
||||
hs_code = inv_line.product_id.get_hs_code_recursively()
|
||||
if not hs_code:
|
||||
|
||||
Reference in New Issue
Block a user