Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
18839 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Someone found the error.

The syntax has to be like this: 

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
naked domain set up Đã xử lý
3
thg 7 25
4384
0
thg 5 25
915
2
thg 3 24
2165
0
thg 1 23
1757
1
thg 11 22
3220