From 743e938baa7b1fadcca8d1fdb193bd7e9be6247c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 2 Mar 2024 11:39:29 +0100 Subject: [PATCH] Set empty currency when reconcile no lines Since f9560247a0fc the currency for the reconciled lines is computed but when there is no line, there is no company to get currency from. Closes #13047 --- modules/account/move.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/account/move.py b/modules/account/move.py index 43243aede1..afce4e9aab 100644 --- a/modules/account/move.py +++ b/modules/account/move.py @@ -2003,7 +2003,7 @@ class ReconcileLines(Wizard): def get_writeoff(self): "Return writeoff amount and company" - company = None + company = currency = None amount = Decimal('0.0') amount_second_currency = Decimal('0.0') second_currencies = set() @@ -2014,6 +2014,7 @@ class ReconcileLines(Wizard): second_currencies.add(line.second_currency) if not company: company = line.account.company + currency = company.currency try: second_currency, = second_currencies except ValueError: @@ -2021,8 +2022,6 @@ class ReconcileLines(Wizard): if second_currency: amount = amount_second_currency currency = second_currency - else: - currency = company.currency return amount, currency, company def transition_start(self):