[fix] added saving of group_bys in saved filters

bzr revid: nicolas.vanhoren@openerp.com-20120106162533-qyqa3okffz1iw38w
This commit is contained in:
niv-openerp 2012-01-06 17:25:33 +01:00
parent f420757151
commit c1e4843ed9
1 changed files with 6 additions and 1 deletions

View File

@ -226,6 +226,8 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search
_.each(data.domains, function(x) {
domain.add(x);
});
var groupbys = _.pluck(data.groupbys, "group_by").join();
context.add({"group_by": groupbys});
var dial_html = QWeb.render("SearchView.managed-filters.add");
var $dial = $(dial_html);
$dial.dialog({
@ -256,7 +258,10 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search
val = parseInt(val, 10);
var filter = this.managed_filters[val];
this.do_clear().then(_.bind(function() {
this.on_search([filter.domain], [filter.context], []);
var groupbys = _.map(filter.context.group_by.split(","), function(el) {
return {"group_by": el};
});
this.on_search([filter.domain], [filter.context], groupbys);
}, this));
} else {
select.val('');