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

I have a search filter for a tree view i created and the default condition of filter is "OR". How can i make the condition set to AND


It should not be State or Name in the filter


  string = "State" name = "filter_state" domain = "[('state', 'in', ['assigned' , 'ready'])]" /> 
string = "Name" name = "filter_contains_name domain = "[('came', 'ilike', 'MYNAME')]" /> 
string = "Carrier" name = "groupby_carrier" context = "{'group_by': 'carrier_id'}" /> 
search >
อวตาร
ละทิ้ง
ผู้เขียน

Please note this is a mutiple <filter> tag

คำตอบที่ดีที่สุด

The following post explains the details of domain notation:

https://www.odoo.com/forum/help-1/domain-notation-using-multiple-and-nested-and-2170

I hope this will help you further!

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

I get this but i am talking about the filter tag in xml for a tree view. if i have multiple <filter> tags, how can i make the condition use AND instead of OR

A domain expression with multiple conditions will by default be combined with the AND operator. E.g., <filter string="Unreconciled" domain="[('amount_residual', '!=', 0), ('account_id.reconcile', '=', True)]" help="Journal items where matching number isn't set" name="unreconciled"/> from the 'view_account_move_line_filter'. Adjust this to suit your requirements

คำตอบที่ดีที่สุด


Did you mean this?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
7
เม.ย. 21
20357
filter with related model field แก้ไขแล้ว
1
ต.ค. 20
4796
change search filter แก้ไขแล้ว
2
พ.ย. 16
4165
1
มี.ค. 15
13621
Search with functional fields แก้ไขแล้ว
4
มี.ค. 15
21101