Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4539 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
15149
1
thg 11 21
5215
0
thg 1 21
2507
8
thg 5 20
8130
0
thg 12 23
3098