From 1b7b14422d606c2343db9cb3e2cfccabaa59008e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 3 Jan 2021 13:04:53 +0100 Subject: [PATCH] Do not fail on missing balance_date The balance date is optional in OFX format. So we fall-back to the default value if it is missing. issue9777 review293041002 --- account.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account.py b/account.py index 86a0e784a5..bf8f12090d 100644 --- a/account.py +++ b/account.py @@ -57,7 +57,10 @@ class StatementImport(metaclass=PoolMeta): if not isinstance(ofx_account.statement, ofxparse.Statement): raise ImportStatementError( gettext('account_statement_ofx.msg_import_no_statement')) - statement.date = ofx_account.statement.balance_date.date() + try: + statement.date = ofx_account.statement.balance_date.date() + except AttributeError: + pass total_amount = sum( t.amount for t in ofx_account.statement.transactions) statement.total_amount = total_amount