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

I'm trying to search strings that end with certain characters. How can I do this with the search method?

Searching  ('name', '=', '%abc') doesn't work. If I use like ('name', 'like', '%abc') it does not search the strings that end with 'abc' but all strings that contain 'abc'.     

The search has to be fast so I cannot use another line where I iterate trough the results to get only those that end with the value.

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

Hi,

Please try 'ilike'

[('field','=ilike','%AB')]

Thanks !!!  


Aswini @ iWesabe



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

before posting I didn't found anything but after posting I found in 5 min https://www.odoo.com/forum/help-1/question/solved-what-does-ilike-in-domain-operator-used-for-58261

Also note that this is the case insensitive version of the search. Use =like rather than =ilike if case matters.

ผู้เขียน

yeah I know, but I'm searching for phone numbers so it does not matter

Related Posts ตอบกลับ มุมมอง กิจกรรม
how to use and in search? แก้ไขแล้ว
2
ธ.ค. 22
16357
1
เม.ย. 20
142
1
มิ.ย. 19
4285
2
มิ.ย. 18
89
0
มี.ค. 18
5899