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

i m facing an issue ,in which i have list of name (list of values) i need to pattern match with (ilike) condition to match contains name with list of values.

this take 'IN' as argument in domain search:

[('payment_ref','in', tuple(label_data.mapped('name')))]

but i need to match with contains name(ilike) condition with label_data.mapped('name')

how can i do that.

list = ['abc','def']

matching should be 'xxabcyy', 'aadef' should match.

Avatar
Annuleer
Beste antwoord

Hi,

You can use the '|' operator in the domain to combine multiple ilike conditions. Here's an example of how you can modify your domain search:


domain=[]

for name in list_of_names:

    domain.extend(['|', ('name', 'ilike', name)])

domain.pop(-2)


Hope it helps

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
nov. 23
1658
1
mei 23
2431
2
mrt. 24
1674
1
nov. 23
2066
4
nov. 23
2833