diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-10-18 18:02:44 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-10-18 18:14:33 +0200 |
| commit | 841f41f95b7cf7d8f13ddce724d60d1d1149886d (patch) | |
| tree | 6409bc34f9dd98ad38a5cf2c86410cf0487343f2 /addons/web/static/tests/fields/basic_fields_tests.js | |
| parent | 25e65d2bcb18f8a39a288176ee28ac0cc1540050 (diff) | |
[FIX] web: domain field should never be considered unset
Indeed, false was already considered as "[]" in edit mode.
Diffstat (limited to 'addons/web/static/tests/fields/basic_fields_tests.js')
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index b7d78afda73..ada39fe3a29 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -1957,7 +1957,7 @@ QUnit.module('basic_fields', { QUnit.test('datetime field with date/datetime widget (with day change)', function (assert) { assert.expect(2); - + this.data.partner.records[0].p = [2]; this.data.partner.records[1].datetime = "2017-02-08 02:00:00"; // UTC @@ -3786,7 +3786,7 @@ QUnit.module('basic_fields', { }); QUnit.test('domain field: handle false domain as []', function (assert) { - assert.expect(2); + assert.expect(3); this.data.partner.records[0].foo = false; this.data.partner.fields.bar.type = "char"; @@ -3812,11 +3812,13 @@ QUnit.module('basic_fields', { return this._super.apply(this, arguments); }, res_id: 1, - viewOptions: { - mode: 'edit', - }, }); + assert.strictEqual(form.$('.o_field_widget[name=foo]:not(.o_field_empty)').length, 1, + "there should be a domain field, not considered empty"); + + form.$buttons.find('.o_form_button_edit').click(); + var $warning = form.$('.o_field_widget[name=foo] .text-warning'); assert.strictEqual($warning.length, 0, "should not display that the domain is invalid"); |
