Odoo Help


Startswith and endswith domain filter in openerp7

on 8/16/13, 7:14 AM 3,648 views


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.


Mohammad Alhashash

--Mohammad Alhashash--
| 5 5 8
Giza, Egypt
--Mohammad Alhashash--


Mohammad Alhashash
On 8/16/13, 9:32 AM

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!

Thinkwell Designs, Dave Burkholder
on 8/16/13, 7:03 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 8/16/13, 7:14 AM
Seen: 3648 times
Last updated: 3/16/15, 8:10 AM