diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-03-31 14:18:22 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | b9d9c6e3bc8d3fd4bb547aadf002652bb7bb9db4 (patch) | |
| tree | 6ce9dadcaa09811f69afeee604b9d3d97fc92ba8 /addons/web/static/test/fields/basic_fields_tests.js | |
| parent | c5d5d7a0ff05d1664e50e5239e5b5efa77a032f6 (diff) | |
[FIX] web: monetary should reset on currency change
This reverts commit 839a07fbed4720fc71c070507c591295722df350.
Indeed, the system will need the `resetOnAnyFieldChange` option as the
`FieldMonetary` will need to be re-rendered if the currency changes.
This does not use the `_fetchSpecialData` system as it will be
refactored later and the currency can be fetched without RPC.
Diffstat (limited to 'addons/web/static/test/fields/basic_fields_tests.js')
| -rw-r--r-- | addons/web/static/test/fields/basic_fields_tests.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/addons/web/static/test/fields/basic_fields_tests.js b/addons/web/static/test/fields/basic_fields_tests.js index 8cea1900c7c..c56f694e1fe 100644 --- a/addons/web/static/test/fields/basic_fields_tests.js +++ b/addons/web/static/test/fields/basic_fields_tests.js @@ -100,10 +100,12 @@ QUnit.module('basic_fields', { }, records: [{ id: 1, + display_name: "$", symbol: "$", position: "before", }, { id: 2, + display_name: "€", symbol: "€", position: "after", }] @@ -1333,7 +1335,7 @@ QUnit.module('basic_fields', { }); QUnit.test('monetary field with real monetary field in model', function (assert) { - assert.expect(3); + assert.expect(4); this.data.partner.fields.qux.type = "monetary"; @@ -1350,7 +1352,7 @@ QUnit.module('basic_fields', { arch:'<form string="Partners">' + '<sheet>' + '<field name="qux"/>' + - '<field name="currency_id" invisible="1"/>' + + '<field name="currency_id"/>' + '<field name="bar"/>' + '</sheet>' + '</form>', @@ -1372,6 +1374,12 @@ QUnit.module('basic_fields', { assert.strictEqual(form.$('.o_form_field_monetary > input').length, 1, "After the onchange, the monetary <input/> should not have been duplicated"); + var $dropdown = form.$('.o_form_field_many2one input').autocomplete('widget'); + form.$('.o_form_field_many2one input').click(); + $dropdown.find('li:not(.o_m2o_dropdown_option):last').mouseenter().click(); + assert.strictEqual(form.$('.o_form_field_monetary > span').html(), "€", + "After currency change, the monetary field currency should have been updated"); + form.destroy(); }); |
