[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.
This commit is contained in:
Denis Ledoux
2015-01-30 13:40:31 +01:00
parent 4c2706d685
commit a804d9a70f
+1 -1
View File
@@ -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) {