跳至內容
選單
此問題已被標幟
1 回覆
12203 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
2
12月 22
15644
1
4月 20
142
1
6月 19
3847
2
6月 18
89
0
3月 18
5416