Skip to content
Snippets Groups Projects
Commit 6b14ceb2 authored by Nans Lefebvre's avatar Nans Lefebvre
Browse files

[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: default avatarNans Lefebvre (len) <len@odoo.com>
parent 87d2661a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment