跳至内容
菜单
此问题已终结
1 回复
4212 查看

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?

形象
丢弃
最佳答案

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')
形象
丢弃
编写者

I used group_operator in field ,Still no change. Thanks

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

相关帖文 回复 查看 活动
2
12月 22
14616
1
11月 21
4715
0
1月 21
2169
8
5月 20
7607
0
12月 23
2825