Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
4341 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

I used group_operator in field ,Still no change. Thanks

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

Publications associées Réponses Vues Activité
2
déc. 22
14772
1
nov. 21
4895
0
janv. 21
2262
8
mai 20
7776
0
déc. 23
2913