Skip to Content
Menu
This question has been flagged
1 Atsakyti
4223 Rodiniai

In odoo 8, how to calculate average for a field in tree view?

I tried,

    <field name = "average_rating" avg="Average"/>

but no change. How to use it?

Portretas
Atmesti
Best Answer

try "sum" instead "avg"

or 

You need to define the field group_operator that by default is sum even if you don't specify it. That it's defined directly in the field, like:

count = fields.Integer('Count', group_operator='avg')
Portretas
Atmesti
Autorius

I used group_operator in field ,Still no change. Thanks

group_operator work only when you group by on any field in list view.

Related Posts Replies Rodiniai Veikla
2
gruod. 22
14631
1
lapkr. 21
4734
0
saus. 21
2181
8
geg. 20
7631
0
gruod. 23
2834