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
This commit is contained in:
Cédric Krier
2024-03-02 11:39:29 +01:00
parent 9aceea55c4
commit 743e938baa
+2 -3
View File
@@ -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):