I need some field to be invisible if 3 conditions are met
How do I express that ?
I tried putting the '&' before, in between, several times, one time
It never works
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I need some field to be invisible if 3 conditions are met
How do I express that ?
I tried putting the '&' before, in between, several times, one time
It never works
Thanks
By default '&' is applied. this code should work if what you want is all these conditions to be true at the same time. But if you want either of this condition to be true, then use '|' instead. Then the syntax would be ['|','|',A,B,C].
I have noticed that in your sample code your are putting field in '' . Don't do that, write field name without '' , the same as you did for False.
So your code would be
attrs="{'invisible': [('firstField '!=', somevalueForFirstField),
('secondField', '!=', someValueForSecondField),
('thirdField','=',False)]}"Hello,
'|' and '&' can be a little tricky.
Assuming you are on Odoo14, the correct way with 2 elements in your code would be:
attrs="{'invisible': ['&',
('firstField '!=', 'somevalueForFirstField'),
('secondField', '!=', 'someValueForSecondField')
]}"So i haven't tryed but maybe the third one needs another '&' in between the second and third element or the first and the second?
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký| Bài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
|---|---|---|---|---|
|
0
thg 11 25
|
4 | |||
|
2
thg 11 25
|
218 | |||
|
0
thg 11 25
|
12 | |||
|
0
thg 11 25
|
4 | |||
|
2
thg 10 25
|
1405 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
I want to make more precise statements
I have this combination
attrs="{'invisible': [('firstField '!=', 'somevalueForFirstField'),('secondField', '!=', 'someValueForSecondField'),
('thirdField','=',False)]}"
I want these 3 conditions to be in and
They are not
Only the third one is being applied