[FIX] account: select default journal with the correct currency
Create a journal J1 of a given type T with no currency.
Create a journal J2 of type T with a currency Y, default currency of company C.
Invoices of type T are created with journal J1 by default.
However, if the currency Y is explicitly set in the context, it will be created
with journal J2, even in company C. In that case J2 will be selected,
because the currency is explicitly set in context.
Now suppose we have a journal J3 of type T with a currency Y', different from
the currency of company C.
Give a lower sequence index to J3 than to J1.
Create an invoice with no currency in context.
Then J3 will be selected despite not being on the correct currency, because
no currency condition has been put in the domain.
We solve these two bugs by always adding the clause in the domain,
and adding that the currency can not be set in the case of the company currency.
opw 2002748
closes odoo/odoo#33795
Signed-off-by:
Nans Lefebvre (len) <len@odoo.com>
Loading
Please register or sign in to comment