From f5aebc17001b2ceb064281b73f4e87624a941797 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 9 Mar 2016 22:17:58 +0100 Subject: [PATCH] OFX: Stronger unique_import_id (to lower the risk of having 2 identical unique_import_id in the same file) Use bank account number as bank statement label, instead of bank number (important when you have several bank accounts at the same bank) --- .../account_bank_statement_import_ofx.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 cdf363b..2bf7312 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 @@ -58,7 +58,8 @@ class AccountBankStatementImport(models.TransientModel): transaction.memo and ': ' + transaction.memo or ''), 'ref': transaction.id, 'amount': transaction.amount, - 'unique_import_id': transaction.id, + 'unique_import_id': '%s-%s-%s' % ( + transaction.id, transaction.payee, transaction.memo), 'bank_account_id': bank_account_id, 'partner_id': partner_id, } @@ -83,7 +84,7 @@ class AccountBankStatementImport(models.TransientModel): )) vals_bank_statement = { - 'name': ofx.account.routing_number, + 'name': ofx.account.number, 'transactions': transactions, 'balance_start': ofx.account.statement.balance, 'balance_end_real':