Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4448 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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')
Ảnh đại diện
Huỷ bỏ
Tác giả

I used group_operator in field ,Still no change. Thanks

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 12 22
14964
1
thg 11 21
5087
0
thg 1 21
2383
8
thg 5 20
7957
0
thg 12 23
3010