From a804d9a70f4288cde4d08d6dc0970a2b0c495b6a Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 30 Jan 2015 13:39:02 +0100 Subject: [PATCH] [FIX] web: possibility to autocomplete 'No' for boolean fields In the search bar. Besides, if the label value of the selection field is set to False, which is quite dummy but accepted The autocomplete crashed. --- addons/web/static/src/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index d2db5b55213..3ac03cf4052 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1453,7 +1453,7 @@ instance.web.search.SelectionField = instance.web.search.Field.extend(/** @lends var results = _(this.attrs.selection).chain() .filter(function (sel) { var value = sel[0], label = sel[1]; - if (!value) { return false; } + if (value === undefined || !label) { return false; } return label.toLowerCase().indexOf(needle.toLowerCase()) !== -1; }) .map(function (sel) {