Tryton - Issues

 

Issue8492

Title statement for multicurrency bank account
Priority feature Status chatting
Superseder Nosy List MR, ced
Type feature request Components account_statement
Assigned To Keywords
Reviews

Created on 2019-07-15.07:14:45 by MR, last changed by ced.

Messages
msg50660 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-07-15.08:45:09
I think the currency should be optional as some statement may not have currency defined.
msg50659 (view) Author: [hidden] (MR) (Tryton translator) Date: 2019-07-15.07:14:44
For multicurrecy bank account (one account number, few currencies) we can create bank accounts (the same bank account number, different curencies), statement journals (the same bank account number, different curencies) 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),
                    ],
                ])
History
Date User Action Args
2019-07-15 08:45:10cedsetstatus: unread -> chatting
nosy: + ced
messages: + msg50660
2019-07-15 07:14:45MRcreate

Showing 10 items. Show all history (warning: this could be VERY long)