[IMP] do not add empty filter groups to the drawer columns

bzr revid: xmo@openerp.com-20130213125606-ykbb2kg9wvfbs2ho
This commit is contained in:
Xavier Morel 2013-02-13 13:56:06 +01:00
parent dfb7493034
commit 2d87d908e2
1 changed files with 16 additions and 9 deletions

View File

@ -1715,15 +1715,22 @@ instance.web.search.Filters = instance.web.search.Input.extend({
.sum() .sum()
.value(); .value();
var col1 = [], col2 = _(this.view.controls).map(function (inputs, group) { var col1 = [], col2 = _(this.view.controls).chain()
var filters = _(inputs).filter(is_group); .map(function (inputs, group) {
return { return {group: group, inputs: inputs};
name: group === 'null' ? "<span class='oe_i'>q</span> " + _t("Filters") : "<span class='oe_i'>w</span> " + group, }).reject(function (item) {
filters: filters, return _(item.inputs).isEmpty();
length: _(filters).chain().map(function (i) { }).map(function (item) {
return i.filters.length; }).sum().value() var filters = _(item.inputs).filter(is_group);
}; return {
}); name: item.group === 'null'
? "<span class='oe_i'>q</span> " + _t("Filters")
: "<span class='oe_i'>w</span> " + item.group,
filters: filters,
length: _(filters).chain().map(function (i) {
return i.filters.length; }).sum().value()
};
}).value();
while (col2.length) { while (col2.length) {
// col1 + group should be smaller than col2 + group // col1 + group should be smaller than col2 + group