From 5c9430f662411a499156e449006c393203883342 Mon Sep 17 00:00:00 2001 From: Thomas Binsfeld Date: Wed, 15 Apr 2020 09:06:29 +0200 Subject: [PATCH] [FIX] web_m2x_options: quick search filter only if search value Before this commit, an empty filter was applied when opening the search more if nothing in the quick search. --- web_m2x_options/static/src/js/form.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/web_m2x_options/static/src/js/form.js b/web_m2x_options/static/src/js/form.js index 3706d4948..2190e02cc 100644 --- a/web_m2x_options/static/src/js/form.js +++ b/web_m2x_options/static/src/js/form.js @@ -258,15 +258,19 @@ odoo.define("web_m2x_options.web_m2x_options", function(require) { var ids = _.map(results, function(x) { return x[0]; }); - dynamicFilters = [ - { - description: _.str.sprintf( - _t("Quick search: %s"), - search_val - ), - domain: [["id", "in", ids]], - }, - ]; + if (search_val) { + dynamicFilters = [ + { + description: _.str.sprintf( + _t("Quick search: %s"), + search_val + ), + domain: [["id", "in", ids]], + }, + ]; + } else { + dynamicFilters = []; + } } self._searchCreatePopup( "search",