diff options
| author | Laurent Smet <las@odoo.com> | 2020-03-31 12:24:04 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-04-16 07:11:07 +0000 |
| commit | 47e6afc3e33d9d1be765541bf570410804bb4a4a (patch) | |
| tree | a2ed51a0d9bb46d8757d033613f4369dd13bd308 /addons/website/static/src/xml/website.editor.xml | |
| parent | 5a99ddf88bfd36bb6004c2dccf2a46c6bfbb5141 (diff) | |
[FIX] account: Fix rounding error when saving invoice
- Activate multi-currency
Company currency: USD
EUR rate: 0.14
- Set the decimal accuracy of Product Price to 5
- Create the following invoice in EUR:
Name Qty Price Unit Subtotal
A 38.0 38.73553 1471.95
B 222.0 4083.19000 906468.18
C 35.0 49.45257 1730.84
D 1.0 17.99000 17.99
- Save the invoice
- Edit the invoice and set a payment term, e.g. 30 days
- Save
There is a difference in debit and credit of 0.01 coming from the
following:
1471.95 / 0.14 = 10513.93
906468.18 / 0.14 = 6474772.71
1730.84 / 0.14 = 12363.14
17.99 / 0.14 = 128.50
SUM = 6497778.28
But the receivable account:
909688.96 / 0.14 = 6497778.285714286 => 6497778.29
When changing the payment term, all invoice lines are recomputed.
`price_unit` and `tax_ids` are in the list of the updated fields, which
triggers the synchronization of accounting and business fields. During
this synchronization, `_get_fields_onchange_subtotal_model` is called
and recomputes the debit amount, leading to the difference.
We only synchronize if the value of the business fields have changed.
opw-2209543
closes odoo/odoo#49605
X-original-commit: 70bd2c9c7a7c8ec832edd2c158f4f61b78cdeb37
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/website/static/src/xml/website.editor.xml')
0 files changed, 0 insertions, 0 deletions
