跳至內容
選單
此問題已被標幟
1 回覆
4344 瀏覽次數

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
14773
1
11月 21
4895
0
1月 21
2264
8
5月 20
7776
0
12月 23
2914