Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4340 มุมมอง

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
Selecting items for one2many relation แก้ไขแล้ว
2
ธ.ค. 22
14772
1
พ.ย. 21
4893
0
ม.ค. 21
2260
8
พ.ค. 20
7775
0
ธ.ค. 23
2913