Odoo Help

0

How to write ORM -Search method where Condition ?

By
Vaibhav
on 11/29/13, 3:28 AM 4,213 views

Hello,

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 ?

Vaibhav
on 12/3/13, 1:36 AM
1

Vaibhav,

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

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

Thanks.

Thanks...:)

Vaibhav
on 1/2/14, 7:25 AM

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.

Register

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)

Stats

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