Odoo Help


This community 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.


How to write ORM -Search method where Condition ?

on 11/29/13, 3:28 AM 3,156 views


I have override search method and I wanted to filter out sales Order with following Condition. Condition / search criteria :

       [ state ='RESERVED' OR (state ='SHIPPED' AND avail='YES') AND invoiced='YES']

How to give above condition in following search method.?

  <obj_name>.search(cr, uid, [])

what are contents of [ ] ?

What do you mean with avail='YES'? Is this a custom field?

Andreas Brueckl
on 11/29/13, 8:14 AM

yes avail is custom field having selection type with values YES or NO, but i am confused that how to write OR AND conditions in search method ?

on 12/3/13, 1:36 AM

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 1/1/14, 10:56 AM


[ state ='RESERVED' OR (state ='SHIPPED' AND avail='YES') AND invoiced='YES']

should be: [(invoiced =Yes),'|',(state=reserved),(state ='SHIPPED'),(avail='YES')]



on 1/2/14, 7:25 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 11/29/13, 3:28 AM
Seen: 3156 times
Last updated: 3/16/15, 8:10 AM