Odoo Help

2

1
3 Answers
5
Clément THOMAS Belgium
5/22/13, 10:02 AM

I think with this syntax it works like AND condition behaviour.

If you want to specify OR condition you must use this syntax :

attrs="{'invisible':['|',('filed_name_1','=',False),('fieled_name_2','=',False)]}"

1 Comment
Alexander Moldavia
5/22/13, 10:26 AM

Thanks, I need to use OR.

7
Dr Obx United Kingdom
2/15/16, 6:04 AM

  attrs="{'invisible':['|',('filed_name_1','=',False),('fieled_name_2','=',False)]}"   for OR

  attrs="{'invisible':['&',('filed_name_1','=',False),('fieled_name_2','=',False)]}"  for AND

<field name="name" attrs="{'invisible': [('condition1', '=', False)], 'required': [('condition2', '=', True)]}"/><!-- as default it works as AND without any additional '|' or '&'-->

You can use more than two conditions, then you should use '|','|','&' depending on conditions order and what you want to achieve.
for example attrs="{'invisible': [('product_lines_id','!=','Computer'),('product_lines_id','!=','Server')],'required':[
'|',('product_lines_id','=','Computer'),('product_lines_id','=','Server')]}"
Ask a Question
Writer
Keep Informed
2 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now