changeset 165e43c6c0da in modules/account_statement_ofx:default
details: 
https://hg.tryton.org/modules/account_statement_ofx?cmd=changeset;node=165e43c6c0da
description:
        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
diffstat:

 account.py |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (15 lines):

diff -r 134097d9e480 -r 165e43c6c0da account.py
--- a/account.py        Sat Dec 19 17:08:44 2020 +0100
+++ b/account.py        Sun Jan 03 13:04:53 2021 +0100
@@ -57,7 +57,10 @@
         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

Reply via email to