Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
4325 Visualizações

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
Cancelar
Melhor resposta

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

Publicações relacionadas Respostas Visualizações Atividade
2
dez. 22
14742
1
nov. 21
4851
0
jan. 21
2241
8
mai. 20
7736
0
dez. 23
2894