changeset b873af64c65a in modules/account_statement_ofx:5.6
details: 
https://hg.tryton.org/modules/account_statement_ofx?cmd=changeset;node=b873af64c65a
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
        (grafted from 165e43c6c0da63549286a2514bb2f35d4f26b223)
diffstat:

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

diffs (15 lines):

diff -r 95d7c46cbf99 -r b873af64c65a account.py
--- a/account.py        Fri Jan 01 16:58:24 2021 +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