Bug tax_rate

This commit is contained in:
2026-07-15 21:19:47 +02:00
parent cb35de91ba
commit df8439f3f5
2 changed files with 7 additions and 2 deletions

View File

@@ -519,6 +519,8 @@ class Purchase(
@property
def taxable_lines(self):
Date = Pool().get('ir.date')
tax_date = getattr(self, 'purchase_date', None) or Date.today()
taxable_lines = []
# In case we're called from an on_change we have to use some sensible
# defaults
@@ -529,7 +531,7 @@ class Purchase(
getattr(line, 'taxes', None) or [],
getattr(line, 'unit_price', None) or Decimal(0),
getattr(line, 'quantity', None) or 0,
None,
tax_date,
))
return taxable_lines

View File

@@ -1596,11 +1596,14 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView):
# In case we're called from an on_change
# we have to use some sensible defaults
if getattr(self, 'type', None) == 'line':
Date = Pool().get('ir.date')
sale = getattr(self, 'sale', None)
tax_date = getattr(sale, 'sale_date', None) or Date.today()
return [(
getattr(self, 'taxes', None) or [],
getattr(self, 'unit_price', None) or Decimal(0),
getattr(self, 'quantity', None) or 0,
None,
tax_date,
)]
else:
return []