تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
13886 أدوات العرض

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.

الصورة الرمزية
إهمال
أفضل إجابة

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.

الصورة الرمزية
إهمال

Thanks for that tip!

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
نوفمبر 23
3297
7
أبريل 21
20749
1
أكتوبر 20
5033
2
نوفمبر 16
4373
4
مارس 15
21243