diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-10-09 12:22:38 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-10-09 12:22:38 +0200 |
| commit | 9241f7ea63f441b5e75a7f694896360ddf0a3278 (patch) | |
| tree | e5ffd4652bf919d42fb2d05dc0c51b8bfb877311 /addons/web/static/tests/widgets/domain_selector_tests.js | |
| parent | b5cbb2827ec8fccd070d3edcf31e8a1098e4ffed (diff) | |
[FIX] web: allow strings as m2o values in domain selector
Since the new views, the field parsing for m2o returns an object with
id and display_name. If the given value to parse is a string, it is
supposed that this is an ID. This was breaking the domain selector
widget which should allow strings as name-strings of m2o values.
Diffstat (limited to 'addons/web/static/tests/widgets/domain_selector_tests.js')
| -rw-r--r-- | addons/web/static/tests/widgets/domain_selector_tests.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/addons/web/static/tests/widgets/domain_selector_tests.js b/addons/web/static/tests/widgets/domain_selector_tests.js index 77d8eeb24da..55ddc971642 100644 --- a/addons/web/static/tests/widgets/domain_selector_tests.js +++ b/addons/web/static/tests/widgets/domain_selector_tests.js @@ -174,6 +174,26 @@ QUnit.module('DomainSelector', { domainSelector.destroy(); }); + + QUnit.test("building a domain with a m2o without following the relation", function (assert) { + assert.expect(1); + + var $target = $("#qunit-fixture"); + + // Create the domain selector and its mock environment + var domainSelector = new DomainSelector(null, "partner", [["product_id", "ilike", 1]], { + debugMode: true, + readonly: false, + }); + testUtils.addMockEnvironment(domainSelector, {data: this.data}); + domainSelector.appendTo($target); + + domainSelector.$('.o_domain_leaf_value_input').val('pad').trigger('input').trigger('change'); + assert.strictEqual(domainSelector.$('.o_domain_debug_input').val(), '[["product_id","ilike","pad"]]', + "string should have been allowed as m2o value"); + + domainSelector.destroy(); + }); }); }); }); |
