跳至內容
選單
此問題已被標幟
3 回覆
18827 瀏覽次數

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

頭像
捨棄
作者 最佳答案

Someone found the error.

The syntax has to be like this: 

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


頭像
捨棄
最佳答案

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)

相關帖文 回覆 瀏覽次數 活動
3
7月 25
4376
0
5月 25
909
2
3月 24
2163
0
1月 23
1755
1
11月 22
3219