From 4929c6f294aa6f4169187dc9fd5bbaae3821d2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 5 May 2023 11:13:43 +0200 Subject: [PATCH] Do not compute amount from reconciled lines if there is no currency Closes #12256 --- modules/account/move.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/account/move.py b/modules/account/move.py index d81d7f6072..28fc1e7366 100644 --- a/modules/account/move.py +++ b/modules/account/move.py @@ -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