From 48869f2aca48d9ab294a4c739fdfcc0ed0d2d5ef Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 11 Jan 2016 11:42:15 +0100 Subject: [PATCH] Better fix: fallback on (required in OFX) and also if we have it --- .../account_bank_statement_import_ofx.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py b/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py index 81a21c8..09f00d3 100644 --- a/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py +++ b/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py @@ -68,8 +68,11 @@ class AccountBankStatementImport(models.TransientModel): # fields are not in bold. # But the 'name' field of account.bank.statement.line is # required=True, so we must always have a value ! + # The field TRNTYPE is a required field in OFX 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) transactions.append(vals_line) except Exception, e: