From fe3d493cc84583fbdd8da4917f9199fdef751dc0 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 29 Nov 2012 12:24:13 +0100 Subject: [FIX] searches with filters using "empty" domain/context values (but not attributes) e.g. @domain="[]" would be seen as non-empty by the search view, and if multiple domains the search view would generate a nonliteral ``['|', '[]', '[]]`` which would just yield ``['|']`` after evaluation and concatenation, which is an invalid domain and would blow up the server. Specifically filter out the values ``[]`` and ``{}`` from filters bzr revid: xmo@openerp.com-20121129112413-yrgncnesqs093jwf --- addons/web/static/src/js/search.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src/js') diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 5b59c7d6912..3917f342391 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1009,6 +1009,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in get_context: function (facet) { var contexts = facet.values.chain() .map(function (f) { return f.get('value').attrs.context; }) + .without('{}') .reject(_.isEmpty) .value(); @@ -1027,6 +1028,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in get_groupby: function (facet) { return facet.values.chain() .map(function (f) { return f.get('value').attrs.context; }) + .without('{}') .reject(_.isEmpty) .value(); }, @@ -1039,6 +1041,7 @@ instance.web.search.FilterGroup = instance.web.search.Input.extend(/** @lends in get_domain: function (facet) { var domains = facet.values.chain() .map(function (f) { return f.get('value').attrs.domain; }) + .without('[]') .reject(_.isEmpty) .value(); -- cgit v1.2.3