Odoo Help

Welcome!

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.

0

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]

By
rosey
on 5/29/15, 12:59 AM 536 views

The Question has been closed for reason: duplicate question

by
Temur
on 06/01/2015 05:51:00

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?

0

Temur

--Temur--
2896
| 6 5 7
Tbilisi, Georgia
--Temur--
Programmer
Temur
On 5/29/15, 4:26 AM

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

Temur
on 5/29/15, 4:28 AM

About This Community

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

Question tools

1 follower(s)

Stats

Asked: 5/29/15, 12:59 AM
Seen: 536 times
Last updated: 6/1/15, 5:51 AM