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

Domain search operators

By
Mihai Marius
on 7/25/14, 4:32 AM 1,172 views

Hi guys,

I have 5 search criteria:

A, B, C, D, E

I whant to search (and i have tried diferent options) like in sql:  select id from obj_obj where A= 2 and B=3 and C=4 and (D=5 or E=6)

Basic idea is:

  •  when D is False :
    • than look for E = 6
  • or when E is False:
    • then look for D=5

Numbers are just for example.

I read some documentation and googling but without real success. I tried [('A','=', 2),('B','=', 3),('C','=', 4),'|',('D','=', 5),('E','=', 6)] but the solution is not working. if i try to add () like: [('A','=', 2),('B','=', 3),('C','=', 4),('|',('D','=', 5),('E','=', 6))] i receive and error: ValueError: Invalid term...

Can you please help?

Many thanks!

'=' updated. I missed when i placed the question. Sorry.

Mihai Marius
on 7/25/14, 4:47 AM
1
Fekete Mihai
On 7/25/14, 4:45 AM

You have to put equal to D and E: [('A','=', 2),('B','=', 3),('C','=', 4),'|',('D','=', 5),('E','=', 6)] instead of [('A','=', 2),('B','=', 3),('C','=', 4),'|',('D','', 5),('E','', 6)].

 

Can you post the exact error?

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

1 follower(s)

Stats

Asked: 7/25/14, 4:32 AM
Seen: 1172 times
Last updated: 3/16/15, 8:10 AM