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

Multiple condition in domain is not working

By
Selverine
on 7/22/16, 4:03 AM 373 views

Hi everyone,


I am trying to use multiple condition for my domain but I got this error:

ValueError: Invalid leaf ('&', ('A', '=', True), ('B', '=', False)


I have no idea why. Everything looks well. I would like to have (A & !B) OR (C & !D )


This is my code (OpenERP 7):

            <field name="domain">['|',('&amp;',('A','=', True),('B','=', False)),('&amp;',('C','!=', True),('D','=', False))]</field>

 

What is wrong with my code? Some idea?


Thank you a lot :-),


Selverine

1
Selverine
On 8/2/16, 4:00 AM

Someone found the error.

The syntax has to be like this: 

['|','&amp;',('A','=', True),('B','=', False),'&amp;',('C','!=', True),('D','=', False)]


0

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 7/22/16, 2:43 PM

Hi Selverine,

Invalid leaf error occurs if you are using a field which does not exist in your object / table.

In your case, it seems the field(s) you have used is / are not in your object.

Please make sure you have given correct name of the fields in domain.

Hi Thanks, I found the error. It was from the syntax ( I will post the answer below)

Selverine
on 8/2/16, 3:59 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

1 follower(s)

Stats

Asked: 7/22/16, 4:03 AM
Seen: 373 times
Last updated: 8/2/16, 4:00 AM