Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM
|
e-Commerce
|
Accounting
|
Inventory
|
PoS
|
Project management
|
MRP
|
etc.
How to add multiple conditions using 'and' 'or' in object.search() function? I added the conditions using '&','|', but one conditions still shows wrong output. [Closed]
I want to add the below condition in object.search() function.
Condition is : result_ids = obj.search(self.cr, self.uid, [(('start_date','>=',form['date_start'] + ' 00:00:00') and ('start_date','<=',form['date_end'] + ' 23:59:59')) or (('end_date','>=',form['date_start'] + ' 00:00:00') and ('end_date','<=',form['date_end'] + ' 23:59:59')) and ('employee_id','in',emp_ids)])
I tried many ways but no output. How can i give this condition?
you should use "prefix notation" in condition statement.
I've explained it somewhere on this forum, I'll give you link to that question...
it's here: https://www.odoo.com/forum/help-1/question/how-to-write-a-domain-in-a-filter-solved-85100#answer-85108
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.
RegisterOdoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.
Test it nowQuestion tools
Stats
Asked: 5/29/15, 12:59 AM |
Seen: 814 times |
Last updated: 6/1/15, 5:51 AM |