fix: UPDATE on_change_lines

This commit is contained in:
sinergia 2024-03-04 13:17:35 -05:00
parent 57f95f0b7d
commit 1ad532c033

View File

@ -47,6 +47,7 @@ class Sale(metaclass=PoolMeta):
self.tax_amount = Decimal('0.0')
self.total_amount = Decimal('0.0')
self.total_discount = Decimal('0.0')
self.total_tip = Decimal('0.0')
if self.lines:
for line in self.lines:
@ -57,6 +58,7 @@ class Sale(metaclass=PoolMeta):
self.tax_amount = self.currency.round(self.tax_amount)
self.total_amount = self.untaxed_amount + self.tax_amount
if self.currency:
self.total_tip = self.currency.round(self.total_tip)
self.total_discount = self.currency.round(self.total_discount)
self.total_amount = self.currency.round(self.total_amount)