This question has been flagged
2 Replies
3827 Views

I have two Boolean fields and i want to give attrs invisible to both fields


 Plz help..

Thanks in advance

Avatar
Discard
Best Answer

Your code:

<field name="my_field" attrs="{'invisible': [('boolean_field','=',False)]}" /> 


If bool1 OR bool2

 <field name="my_field" attrs="{'invisible': ['|', ('boolean_field1','=',False), ('boolean_field2','=',False)]}" /> 

If bool1 AND bool2 

 <field name="my_field" attrs="{'invisible': ['&', ('boolean_field1','=',False), ('boolean_field2','=',False)]}" /> 

Avatar
Discard
Best Answer

If It is a many2one field You can Try

fields.many2one('test.test', 'String',domain=[('type', '&lt;>', 'service'),('is_raw_material','=',True)])

By Default it uses AND  condition.

You Can Specify for OR operation like below

fields.many2one('test.test', 'String',domain=['|',('is_cutting','=',True),('is_forging','=',True)] )

Avatar
Discard