minor fix get_tax_amount

This commit is contained in:
Elvis 2023-06-30 15:14:18 -05:00
parent 9ff52e7b50
commit ef8ee435b8
1 changed files with 2 additions and 1 deletions

View File

@ -132,7 +132,8 @@ class Sale(metaclass=PoolMeta):
amounts = []
if taxes_update_id:
for l in self.lines:
if not l.product or (not hasattr(l.product, 'extra_tax') or not l.product.extra_tax):
classification_tax = any(t.classification_tax == '02' for t in l.taxes)
if not l.product or (not hasattr(l.product, 'extra_tax') or not l.product.extra_tax or not classification_tax):
continue
raw_val = Decimal(float(l.product.extra_tax) * l.quantity)
val = self.currency.round(raw_val)