diff options
| author | Denis Ledoux <dle@odoo.com> | 2016-12-28 14:01:11 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2016-12-28 14:19:18 +0100 |
| commit | dfcc0c40b1f9ca218cc62f3fbc23a43a7b93f63c (patch) | |
| tree | e473b98a113bc6e4d3266edd5dc2b55a864a6c62 /setup/setup_dev.py | |
| parent | 66732acabf87d0813a8d08a8c98b83a586978b7f (diff) | |
[FIX] account, stock_account: anglo saxong cost price currency rounding
When selling in a foreign currency,
A double currency rate change, one in each way, was applied when creating the good cost
move line of the invoice, which leaded to some precision loss when the decimal accuracy was
set with a number of digits greater than the currencies digits rounding
e.g.
Product cost price: 52.56422
CAD to USD rate: 0.7383
The product cost price is always in the company currency
while `_anglo_saxon_sale_move_lines` always returned the price
in the currency of the invoice. A first conversion rate was applied
from the company currency to the invoice currency.
52.56422 * 0.7383 = 38.808163625999995, rounded to 38.81
Then, when validating the invoice, and creating the move line,
the price was then converted again, to the company currency,
as the debit/credit of a move line is always in the company currency:
38.81 / 0.7383 = 52.566707300555336, rounded to 52.57
The cost price of the product in the good cost move line was therefore
set to 52.57, insteaf of 52.56, because of this precision loss.
With this revision, we avoid to do the currency rate conversion
two times, in both ways, to avoid the precision loss.
opw-702045
Diffstat (limited to 'setup/setup_dev.py')
0 files changed, 0 insertions, 0 deletions
