[FIX] catch possible exception in search.js

The search view tries to evaluate the category of a filter in order
to put it in the filters or in the group by sub menu.  The pyeval.eval
function could throw an exception, which is not cool if it crashes the
client.  This fix make sure that the exception is caught.
This commit is contained in:
Géry Debongnie
2014-10-21 09:33:51 +02:00
parent 2e43d4be29
commit 748de602ef
+6 -4
View File
@@ -662,10 +662,12 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
function eval_item (item) {
var category = 'filters';
if (item.attrs.context) {
var context = instance.web.pyeval.eval('context', item.attrs.context);
if (context.group_by) {
category = 'group_by';
}
try {
var context = instance.web.pyeval.eval('context', item.attrs.context);
if (context.group_by) {
category = 'group_by';
}
} catch (e) {}
}
return {
item: item,