[FIX] empty root groups in aggregations

bzr revid: xmo@openerp.com-20110921071925-by8fl0o85v76d6am
This commit is contained in:
Xavier Morel 2011-09-21 09:19:25 +02:00
parent 3b91aa0c29
commit b9869f9354
1 changed files with 4 additions and 0 deletions

View File

@ -541,6 +541,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
if (_.isEmpty(records)) {
records = this.groups.get_records();
}
records = _(records).compact();
var count = 0, sums = {};
_(columns).each(function (column) {
@ -1235,6 +1236,9 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L
},
get_records: function () {
if (_(this.children).isEmpty()) {
if (!this.datagroup.length) {
return;
}
return {
count: this.datagroup.length,
values: this.datagroup.aggregates