Skip to content
Snippets Groups Projects
Commit 47bb1bd2 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] account, purchase, sale, currency: companies rates

In Odoo 9.0, the field `company_id` has been moved
from the `res.currency` model to the `res.currency.rate`
model.

The different reports applying the currency rates on the amount
at date have not been updated according to this change. This
includes the sales, purchases and invoices analysis report.

Basically, before 9.0, there was one `res.currency`
per existing currency per company. A simple `JOIN`
on the `res_currency` table was therefore enough
to apply the currency rate.

From 9.0, the currency records are shared between
companies. It's the rates (`res.currency.rate`) that can be
set a on specific company. The simple `JOIN` on
`res_currency` is therefore no longer enough: the company condition
must be added. Only rates from the specific company
(e.g the company of the invoice) must be considered, or rates
without companies.

We take the opportunity to factor out the method, so, if a correction
must be done, it must be done in one place only.

opw-669129
parent fbf6f2cd
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