Browse Source

Better fix: fallback on <TRNTYPE> (required in OFX) and also <CHECKNUM> if we have it

pull/54/head
Alexis de Lattre 9 years ago
parent
commit
48869f2aca
  1. 5
      account_bank_statement_import_ofx/account_bank_statement_import_ofx.py

5
account_bank_statement_import_ofx/account_bank_statement_import_ofx.py

@ -68,8 +68,11 @@ class AccountBankStatementImport(models.TransientModel):
# fields are not in bold. # fields are not in bold.
# But the 'name' field of account.bank.statement.line is # But the 'name' field of account.bank.statement.line is
# required=True, so we must always have a value ! # required=True, so we must always have a value !
# The field TRNTYPE is a required field in OFX
if not vals_line['name']: if not vals_line['name']:
vals_line['name'] = '-'
vals_line['name'] = transaction.type.capitalize()
if transaction.checknum:
vals_line['name'] += ' %s' % transaction.checknum
total_amt += float(transaction.amount) total_amt += float(transaction.amount)
transactions.append(vals_line) transactions.append(vals_line)
except Exception, e: except Exception, e:

Loading…
Cancel
Save