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

I've added a new field to the res.partner model. This field dummy is a many2many, related to a customized model named res.partner.link.category. In the tree view of partners, if I click on search and then on advanced search, I can create a new filter, selecting a field from res.partner and setting its value/s.

The problem is that I can't see my new field in the advanced search. There's an existing many2many field in res.partner, named category_id, and I can see this one there, in the advanced search. I need my field to behave like that one.

Can anyone help me, please?

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

If you need to search using Advanced search, then the field needs to be available in your database.  i.e. store=True is a must.

So, add store=True for your related field.

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

Thank you! That's a good point, but I've just found the problem and in my case was the one I'm going to post now.

ผู้เขียน คำตอบที่ดีที่สุด

In my case, the problem is that my table res.partner.link.category didn't have a column named name, and it didn't have set the attribute _rec_name, so it was impossible to find anything.

อวตาร
ละทิ้ง

Not necessarily. You can still have a name_search method defined to be used to search the records. But I guess, it is not currently available as well.

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 21
9462
2
พ.ย. 23
3173
7
เม.ย. 21
20555
filter with related model field แก้ไขแล้ว
1
ต.ค. 20
4925
change search filter แก้ไขแล้ว
2
พ.ย. 16
4277