summaryrefslogtreecommitdiff
path: root/addons/test_mail/tests/test_performance.py
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2020-03-10 14:08:53 +0000
committerNicolas Martinelli <nim@odoo.com>2020-03-11 11:06:11 +0000
commit4aa7e101a90f2281e581389e7c24909dd35fb00f (patch)
treead8f270fb6cce3ec5d980348a212e54df5a704c5 /addons/test_mail/tests/test_performance.py
parent8ec70c9072ccd3b49b4b0c3cd7cdf22fb21cd4af (diff)
[FIX] point_of_sale: rounding error
- Set 'Product Unit of Measure' to 5 - Set the UoM rounding to 0.001 - Create an excluded tax of 6 % - Create a product costing 7.0 - Open the POS, add the product with a quantity of 0.535 The tax is 0.22 instead of 0.23. The root cause of the issue is the in JS: ``` round_pr(0.535, Math.pow(10,-5)) * 7 = 3.744999999999999 round_pr(0.535, 0.00001) * 7 = 3.745 ``` The numerical error impacts the tax computation later on. As a workaround, we round by the maximum between the UoM rounding and the 'Product Unit of Measure', which is what will be done in the backend anyway. opw-2205092 closes odoo/odoo#47372 X-original-commit: 125cdf96e94a94146804091ad47e701240c2529e Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/test_mail/tests/test_performance.py')
0 files changed, 0 insertions, 0 deletions