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

Hi,

I have an extended model of `res.partner` with a field named `x_subsidiary_of`.

 

When I am in the search view of customer invoices I would like to group invoices by this `x_subsidiary_of` field.

I've tried to modify the search view adding the following line :

    <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id.x_subsidiary_of'}"/>

 

But I get this error :

    AssertionError: Fields in 'groupby' must be regular database-persisted fields (no function or related fields), or function fields with store=True

How could I achieve this ?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

What type is your x_subsidiary_of field?

Extend the invoice module and use field.related and store=True.

Then add the field to you customer invoice view (with invisible="1" if you like).

 

Regards.

 

อวตาร
ละทิ้ง
ผู้เขียน

Type is many2one. I try your tip and will let you know the result. Cheers

ผู้เขียน

Thanks that worked like a charm :)

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ย. 17
4704
0
ส.ค. 25
12
0
ส.ค. 25
6
0
ส.ค. 25
105
1
ส.ค. 25
263