changeset 573053a33b80 in modules/account_statement_ofx:5.0
details: 
https://hg.tryton.org/modules/account_statement_ofx?cmd=changeset;node=573053a33b80
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 0ff26035baba -r 573053a33b80 account.py
--- a/account.py        Sat Apr 04 17:48:44 2020 +0200
+++ b/account.py        Sun Jan 03 13:04:53 2021 +0100
@@ -67,7 +67,10 @@
                     })
         if not isinstance(ofx_account.statement, ofxparse.Statement):
             self.raise_user_error('ofx_not_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