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
This commit is contained in:
+4
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user