From b9869f93545b711ce4157a1f47a469d7c86bb284 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 21 Sep 2011 09:19:25 +0200 Subject: [PATCH] [FIX] empty root groups in aggregations bzr revid: xmo@openerp.com-20110921071925-by8fl0o85v76d6am --- addons/web/static/src/js/view_list.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index f8a89cd34a1..0a27704b741 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -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