Browse Source

Merge pull request #62 from akretion/8.0-ofx-stronger-unique_import_id

OFX: stronger unique_import_id
pull/72/head
Pedro M. Baeza 8 years ago
committed by GitHub
parent
commit
36d4fd5915
  1. 5
      account_bank_statement_import_ofx/account_bank_statement_import_ofx.py
  2. 2
      account_bank_statement_import_ofx/tests/test_import_bank_statement.py

5
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':

2
account_bank_statement_import_ofx/tests/test_import_bank_statement.py

@ -22,7 +22,7 @@ class TestOfxFile(TransactionCase):
dict(data_file=ofx_file))
bank_statement.import_file()
bank_st_record = self.bank_statement_model.search(
[('name', '=', '000000123')])[0]
[('name', '=', '123456')])[0]
self.assertEquals(bank_st_record.balance_start, 2156.56)
self.assertEquals(bank_st_record.balance_end_real, 1796.56)

Loading…
Cancel
Save