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

Hi folks,

when I define filters in my xml view like:

          <filter name="group_latest" string="Latest" domain="[('date', '>=', time.strftime('%Y-%m-%d'))]"/>
          <filter name="lat_north" string="Nördl. Hem" domain="[('geoip_latitude', '>=', 0)]"/>

and I use them both in my view they are joined by OR. But I want them to be exclusive, joined by AND so first filter is applied AND ALSO the second filter is applied on the results of the first filter.

Is this possible?

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

There are special tag <separator/> for that. Filters from the same group (outlined by <separator/> ) are joined by OR, and filters from different groups goes as a separate items and are joined by AND

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

You could create one other filter this way :

    <filter name="group_latest_north" string="Latest Nördl. Hem" domain="[('date', '>=', time.strftime('%Y-%m-%d')), ('geoip_latitude', '>=', 0)]"/>

Which will apply the AND condition.

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

that's not what I need. It will increase the complexity to much, cause there are lot more filters implemented and to implement all the combinations of joins (for more than 3 at a time) is not wanted. but thx anyway

Ok sorry. I don't think we can bind predefined filters with AND condition.

Related Posts ตอบกลับ มุมมอง กิจกรรม
Questions about filters แก้ไขแล้ว
1
ก.ค. 15
4643
0
พ.ค. 17
3586
0
ก.ค. 15
3615
Add a filter to an existing tree view แก้ไขแล้ว
1
มี.ค. 15
19126
1
มี.ค. 15
5117