İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
13802 Görünümler

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.

Avatar
Vazgeç
En İyi Yanıt

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.

Avatar
Vazgeç

Thanks for that tip!

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Kas 23
3198
7
Nis 21
20605
1
Eki 20
4966
2
Kas 16
4297
4
Mar 15
21184