Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4356 Vistas

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
Descartar
Mejor respuesta

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
Descartar
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.

Publicaciones relacionadas Respuestas Vistas Actividad
2
dic 22
14787
1
nov 21
4908
0
ene 21
2274
8
may 20
7785
0
dic 23
2925