[FIX] only aggregate columns explicitly asking for aggregation ...
authorXavier Morel <xmo@openerp.com>
Mon, 14 Nov 2011 08:18:53 +0000 (09:18 +0100)
committerXavier Morel <xmo@openerp.com>
Mon, 14 Nov 2011 08:18:53 +0000 (09:18 +0100)
Instead of relying only on the column's group_operator, ensure the
view itself asks for the aggregation function (by checking if the
corresponding field attribute is set).

If the @group_operator function is not set on the field (even without
a label, it just has to be *there* so `<field sum=""/>` would work),
do not aggregate the column at all.

bzr revid: xmo@openerp.com-20111114081853-a9ja0zdaxk2261nd

addons/web/static/src/js/view_list.js

index 207d12a..d687faa 100644 (file)
@@ -365,6 +365,9 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
                     return {};
                 }
                 var aggregation_func = column['group_operator'] || 'sum';
+                if (!(aggregation_func in column)) {
+                    return {};
+                }
 
                 return _.extend({}, column, {
                     'function': aggregation_func,