Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
12279 Weergaven

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.

Avatar
Annuleer
Beste antwoord

Hi,

Please try 'ilike'

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

Thanks !!!  


Aswini @ iWesabe



Avatar
Annuleer
Auteur

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.

Auteur

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

Gerelateerde posts Antwoorden Weergaven Activiteit
2
dec. 22
15768
1
apr. 20
142
1
jun. 19
3919
2
jun. 18
89
0
mrt. 18
5520