summaryrefslogtreecommitdiff
path: root/odoo/addons/base/tests/test_float.py
diff options
context:
space:
mode:
authorMitali Patel <mpa@odoo.com>2019-06-19 10:21:23 +0000
committerRavi Gohil <rgo@odoo.com>2019-08-06 05:28:35 +0000
commit857c4851754dcddf9e6dc7b39585914beaf89c88 (patch)
treeeb1865b406caf7b60a15c1ddfda81bd0b1f8c6a0 /odoo/addons/base/tests/test_float.py
parent0be039989cb7bea936d86bea32c3f39b24a5328c (diff)
[IMP] base/web: store more precision digits for rate field
Currently, only 6 digits after decimal point is stored in database and for some currencies it may require to have more digits after decimal precision to correctly convert rates, like MXN -> USD currency. So, we allow maximum digits to be stored in database. On the view side, wherever rate is editable(form or tree view), we show 12 digits after decimal point and on list view, we truncate limit it to 6 digits. Also, a bug is fixed for web where 'digits' attribute for float field on list view isn't considered. Also, we have to remove a test case statement which only checks for 6 digits for a float number. task: 2024668 closes: #34279 Signed-off-by: Josse Colpaert <jco@openerp.com>
Diffstat (limited to 'odoo/addons/base/tests/test_float.py')
-rw-r--r--odoo/addons/base/tests/test_float.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/odoo/addons/base/tests/test_float.py b/odoo/addons/base/tests/test_float.py
index 4dbf1f5f139..7ece1b0b8ce 100644
--- a/odoo/addons/base/tests/test_float.py
+++ b/odoo/addons/base/tests/test_float.py
@@ -172,8 +172,7 @@ class TestFloatPrecision(TransactionCase):
self.assertEqual(rate.rate, expected,
'Roundtrip error: got %s back from db, expected %s' % (rate, expected))
- # res.currency.rate uses 6 digits of precision by default
- try_roundtrip(2.6748955, 2.674896, '2000-01-01')
+ # res.currency.rate no more uses 6 digits of precision by default, it now uses whatever precision it gets
try_roundtrip(10000.999999, 10000.999999, '2000-01-03')
#TODO re-enable those tests when tests are made on dedicated models