summaryrefslogtreecommitdiff
path: root/odoo/addons/test_new_api/tests/test_new_fields.py
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2019-06-20 14:21:16 +0000
committerMartin Trigaux <mat@odoo.com>2019-07-03 11:16:24 +0000
commit573ccf098f887cb4233ff75772b4da8e3e5a45a1 (patch)
tree2abf22d0198f7da608d2db6d37a74ef2e4bd5df8 /odoo/addons/test_new_api/tests/test_new_fields.py
parente2bd3e328aa0a4e2a438a3b0e9f3fc3fa5601b62 (diff)
[FIX] fields: implement _description_digits
Otherwise, fields_get returns the string, not the digits Add test
Diffstat (limited to 'odoo/addons/test_new_api/tests/test_new_fields.py')
-rw-r--r--odoo/addons/test_new_api/tests/test_new_fields.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/odoo/addons/test_new_api/tests/test_new_fields.py b/odoo/addons/test_new_api/tests/test_new_fields.py
index 492255df83e..c0dd3efd536 100644
--- a/odoo/addons/test_new_api/tests/test_new_fields.py
+++ b/odoo/addons/test_new_api/tests/test_new_fields.py
@@ -443,6 +443,12 @@ class TestFields(common.TransactionCase):
record.number = 2.4999999999999996
self.assertEqual(record.number, 2.50)
+ def test_21_float_digits(self):
+ """ test field description """
+ precision = self.env.ref('test_new_api.decimal_new_api_number')
+ description = self.env['test_new_api.mixed'].fields_get()['number2']
+ self.assertEqual(description['digits'], (16, precision.digits))
+
def check_monetary(self, record, amount, currency, msg=None):
# determine the possible roundings of amount
if currency: