From fbf4c6dc0f815b69ab07a8f9c1765e9ab6e858ba Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 21 Feb 2012 15:05:17 +0100 Subject: [PATCH] [FIX] incorrect handling of saved filter group_by when not present or an array bzr revid: xmo@openerp.com-20120221140517-fs0axg9w8irapw06 --- addons/web/static/src/js/search.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 74ae65785f9..2809b3792de 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -263,9 +263,14 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea var filter = this.managed_filters[val]; this.do_clear(false).then(_.bind(function() { select.val('get:' + val); - var groupbys = _.map(filter.context.group_by.split(","), function(el) { - return {"group_by": el}; - }); + + var groupbys = []; + var group_by = filter.context.group_by; + if (group_by) { + groupbys = _.map( + group_by instanceof Array ? group_by : group_by.split(','), + function (el) { return { group_by: el }; }); + } this.on_search([filter.domain], [filter.context], groupbys); }, this)); } else {