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

I want to add a filter to a search view in whose domain I want to make reference to a field of another model, i.e:

<filter name="filter_name" string="Filter String" domain="[('field','=',ref(base.company).some_field)]" help="Filter by some field"/>

but I don't know how to do it, I also tried calling a method in the model, trying referencing self.env, no luck either way.

So my question is how can I add a 'dynamic domain' to my search filter, I want to filter by checking a value stored in another model, thanks

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

I want to avoid having to create a reference field in my model, it doesn't look right to have an extra field just for filtering purposes in my view

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ย. 23
3196
0
พ.ค. 23
2840
2
ม.ค. 23
3647
7
เม.ย. 21
20594
filter with related model field แก้ไขแล้ว
1
ต.ค. 20
4955