diff options
| author | Mathieu Duckerts-Antoine <dam@odoo.com> | 2020-07-23 08:13:39 +0000 |
|---|---|---|
| committer | Julien Mougenot <jum@odoo.com> | 2020-07-31 08:04:57 +0000 |
| commit | dc8973fd6e44975fc79af184282434b0aa1c11aa (patch) | |
| tree | c37c5928735dc0542ba39dfd2f732c3ded89d022 /addons/web/static/tests/control_panel/favorite_menu_tests.js | |
| parent | 9dd2c7fdc8b593c0cfaa733351b0096cfc5e2f27 (diff) | |
[FIX] web: default operators for search fields
During the refactoring of the control panel (https://github.com/odoo/odoo/pull/41268)
a regression concerning the operator used for the fields set as
search_default was introduced: the default operator was fixed to '='
while it would have been necessary to take into consideration the
optional 'operator' attribute or the field types. Moreover, the default
operator associated to many2one fields when using autocompletion was
also mistakenly set to 'ilike' instead of '='. The present commit
restores the previous behavior.
closes odoo/odoo#55099
X-original-commit: 1f8e93fc590a6c7ef6b93953058f2dcd643ac620
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Diffstat (limited to 'addons/web/static/tests/control_panel/favorite_menu_tests.js')
| -rw-r--r-- | addons/web/static/tests/control_panel/favorite_menu_tests.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/tests/control_panel/favorite_menu_tests.js b/addons/web/static/tests/control_panel/favorite_menu_tests.js index d01afdfb063..bf2ec76d564 100644 --- a/addons/web/static/tests/control_panel/favorite_menu_tests.js +++ b/addons/web/static/tests/control_panel/favorite_menu_tests.js @@ -371,7 +371,7 @@ odoo.define('web.favorite_menu_tests', function (require) { search: function (searchQuery) { const { domain, groupBy, timeRanges } = searchQuery; if (firstSearch) { - assert.deepEqual(domain, [['foo', '=', 'a']]); + assert.deepEqual(domain, [['foo', 'ilike', 'a']]); assert.deepEqual(groupBy, ['date_field:month']); assert.deepEqual(timeRanges, { comparisonId: "previous_period", @@ -399,7 +399,7 @@ odoo.define('web.favorite_menu_tests', function (require) { const { domain, groupBy, timeRanges } = controlPanel.getQuery(); assert.deepEqual(domain, [ "&", - ["foo", "=", "a"], + ["foo", "ilike", "a"], "&", ["date_field", ">=", "2019-01-01"], ["date_field", "<=", "2019-12-31"] |
