[FIX] correctly take in account default group_by (from action context)

group_by are alternative: use the one from the search view if there is one
otherwise use the one from the action
and default is no group by

lp bug: https://launchpad.net/bugs/902302 fixed

bzr revid: xmo@openerp.com-20111212141656-w41nnfhzw9kcu93k
This commit is contained in:
Xavier Morel 2011-12-12 15:16:56 +01:00
parent 26eac2765c
commit e688de835f
1 changed files with 7 additions and 3 deletions

View File

@ -346,15 +346,19 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View
},
do_searchview_search: function(domains, contexts, groupbys) {
var self = this,
controller = this.views[this.active_view].controller;
controller = this.views[this.active_view].controller,
action_context = this.action.context || {};
this.rpc('/web/session/eval_domain_and_context', {
domains: [this.action.domain || []].concat(domains || []),
contexts: [this.action.context || {}].concat(contexts || []),
contexts: [action_context].concat(contexts || []),
group_by_seq: groupbys || []
}, function (results) {
self.dataset.context = results.context;
self.dataset.domain = results.domain;
controller.do_search(results.domain, results.context, results.group_by);
var groupby = results.group_by.length
? results.group_by
: action_context.group_by;
controller.do_search(results.domain, results.context, groupby || []);
});
},
/**