[FIX] web,crm: view_list respect group operator defined in the view.
Remove useless avg defined on crm view. If you define avg='Average Values' in a view, now we see in the footer of list view the average.
This commit is contained in:
parent
4ca06e0255
commit
633780a00c
|
@ -518,7 +518,7 @@
|
||||||
<field name="source_id" invisible="1"/>
|
<field name="source_id" invisible="1"/>
|
||||||
<field name="stage_id"/>
|
<field name="stage_id"/>
|
||||||
<field name="planned_revenue" sum="Expected Revenues"/>
|
<field name="planned_revenue" sum="Expected Revenues"/>
|
||||||
<field name="probability" avg="Avg. of Probability"/>
|
<field name="probability" />
|
||||||
<field name="section_id" groups="base.group_multi_salesteams"/>
|
<field name="section_id" groups="base.group_multi_salesteams"/>
|
||||||
<field name="user_id"/>
|
<field name="user_id"/>
|
||||||
<field name="referred" invisible="1"/>
|
<field name="referred" invisible="1"/>
|
||||||
|
|
|
@ -2182,7 +2182,6 @@ instance.web.list.Column = instance.web.Class.extend({
|
||||||
id: id,
|
id: id,
|
||||||
tag: tag
|
tag: tag
|
||||||
});
|
});
|
||||||
|
|
||||||
this.modifiers = attrs.modifiers ? JSON.parse(attrs.modifiers) : {};
|
this.modifiers = attrs.modifiers ? JSON.parse(attrs.modifiers) : {};
|
||||||
delete attrs.modifiers;
|
delete attrs.modifiers;
|
||||||
_.extend(this, attrs);
|
_.extend(this, attrs);
|
||||||
|
@ -2209,10 +2208,14 @@ instance.web.list.Column = instance.web.Class.extend({
|
||||||
if (this.type !== 'integer' && this.type !== 'float') {
|
if (this.type !== 'integer' && this.type !== 'float') {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
var aggregation_func = this['group_operator'] || 'sum';
|
|
||||||
if (!(aggregation_func in this)) {
|
var aggregation_func = (this.sum && 'sum') || (this.avg && 'avg') ||
|
||||||
|
(this.max && 'max') || (this.min && 'min') || this.group_operator;
|
||||||
|
|
||||||
|
if (!aggregation_func) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
var C = function (fn, label) {
|
var C = function (fn, label) {
|
||||||
this['function'] = fn;
|
this['function'] = fn;
|
||||||
this.label = label;
|
this.label = label;
|
||||||
|
|
Loading…
Reference in New Issue