diff options
| author | Mohammed Shekha <msh@odoo.com> | 2020-08-17 11:13:21 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2020-12-21 10:52:25 +0000 |
| commit | 61f8ced67992b20edfac139c749ec00939f408a3 (patch) | |
| tree | 6179b70849239cd4f3f24ae4675fcebd9c6d83d0 /addons/web/static/tests/views/sample_server_tests.js | |
| parent | e9ef98410fa6acba165f3056d9c52f8e68cc768b (diff) | |
[FIX] web: SampleServer: round float values
before this commit: when field is float type it display too much decimal
precision value, it should be fixed to 2 precision for sample data.
after this commit: float field will display 2 decimal precision value.
task-2318503
closes odoo/odoo#55987
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Kamesh Patel <kat@odoo.com>
Diffstat (limited to 'addons/web/static/tests/views/sample_server_tests.js')
| -rw-r--r-- | addons/web/static/tests/views/sample_server_tests.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/tests/views/sample_server_tests.js b/addons/web/static/tests/views/sample_server_tests.js index 24bb60611ea..9eedd16c7f5 100644 --- a/addons/web/static/tests/views/sample_server_tests.js +++ b/addons/web/static/tests/views/sample_server_tests.js @@ -77,7 +77,7 @@ odoo.define('web.sample_server_tests', function (require) { QUnit.module("Basic behaviour"); QUnit.test("Sample data: people type + all field names", async function (assert) { - assert.expect(24); + assert.expect(25); mock.patch(session, { company_currency_id: 4, @@ -134,6 +134,9 @@ odoo.define('web.sample_server_tests', function (require) { assertBetween('age', 0, MAX_INTEGER); assertBetween('salary', 0, MAX_MONETARY); + // check float field have 2 decimal rounding + assert.strictEqual(rec.height, parseFloat(parseFloat(rec.height).toFixed(2))); + const selectionValues = this.fields['res.users'].type.selection.map( (sel) => sel[0] ); |
