Odoo Help


function call in WHERE clause with ORM

Clément TheSecond
on 5/4/15, 9:07 AM 837 views

I want to call a pgsql function In my select as follow :

select name from my_table where soundex(name) = 'foo'

So I include a tuple in before to do the select :

query += [('soundex(name)','=',soundex2(foo) ) ]


product_count = product_obj.search_count(cr, uid, query, context=context)

And I've got the following error :

Invalid field 'soundex(name)' in leaf "<osv.ExtendedLeaf: ('soundex(name)', '=', u'EKLP') on product_template (ctx: )>" 

So, I do I call the soundex function inside of the 'Where' clause ?

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

1 follower(s)


Asked: 5/4/15, 9:07 AM
Seen: 837 times
Last updated: 5/4/15, 9:11 AM