Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4359 Zobrazení

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?

Avatar
Zrušit
Nejlepší odpověď

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')
Avatar
Zrušit
Autor

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 Odpovědi Zobrazení Aktivita
2
pro 22
14791
1
lis 21
4913
0
led 21
2275
8
kvě 20
7788
0
pro 23
2926