Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
13836 Vizualizări

Hi,

I know that the below are supported operators by openerp7.

  =, !=, >, >=, <, <=, like, ilike, in, not in, child_of, parent_left, parent_right

I would like to implement startswith and endswith search in openerp. Ex

AB* (starts with AB)
*AB (Ends with AB)

Is there a way to do it with the openerp framework itself without executing them as sql statements with cr.execute(). Specifically i would like to do that in global filter.

Thanks for your insights.

Imagine profil
Abandonează
Cel mai bun răspuns

Use '=like' and '=ilike' operators.

starts with AB is [('field','=like','AB%')]

ends with AB is [('field','=like','%AB')]

Use ilike for case insensitive match.

like and ilike operators (without '=') automatically add wildcard before and after search value.

Imagine profil
Abandonează

Thanks for that tip!

Related Posts Răspunsuri Vizualizări Activitate
2
nov. 23
3242
7
apr. 21
20672
1
oct. 20
5001
2
nov. 16
4325
4
mar. 15
21223