Do not fail on missing writeoff account for reconciliation

There is no need to check for second currency if there is no account.
This commit is contained in:
Cédric Krier
2023-05-10 13:14:00 +02:00
parent c1ca4757b3
commit 2015647285
+1 -1
View File
@@ -1607,7 +1607,7 @@ class Line(MoveLineMixin, ModelSQL, ModelView):
reconcile_party if account and account.party_required else None)
line.debit = amount if amount > 0 else 0
line.credit = -amount if amount < 0 else 0
if account.second_currency:
if account and account.second_currency:
with Transaction().set_context(date=date):
line.amount_second_currency = Currency.compute(
company.currency, amount,