statement for multicurrency bank account
For multi currency bank accounts (e.g. one account number, few currencies) we can create bank accounts (the same bank account number, different currencies), statement journals (the same bank account number, different currencies) but when we try to import statement we get the error because get_by_bank_account from account_statement/journal.py search only by bank account number and can't get unique journal.
I propose to change the mentioned function (and calls to it from all account_statement_...):
def get_by_bank_account(cls, company, number, currency):
journals = cls.search([
('company', '=', company),
('currency', '=', currency),
['OR',
('bank_account.numbers.number', '=', number),
('bank_account.numbers.number_compact', '=', number),
],
])
Edited by Udo Spallek