Do not compute amount from reconciled lines if there is no currency

Closes #12256
This commit is contained in:
Cédric Krier
2023-05-05 11:13:43 +02:00
parent e76d45a2ff
commit 4929c6f294
+5 -5
View File
@@ -2359,12 +2359,12 @@ class ReconcileShow(ModelView):
@fields.depends('lines', 'currency', 'company')
def on_change_lines(self):
amount = Decimal(0)
for line in self.lines:
if line.second_currency == self.currency:
amount += line.amount_second_currency
elif line.currency == self.currency:
amount += line.debit - line.credit
if self.currency:
for line in self.lines:
if line.second_currency == self.currency:
amount += line.amount_second_currency
elif line.currency == self.currency:
amount += line.debit - line.credit
amount = self.currency.round(amount)
self.write_off_amount = amount