Odoo Help


How to give two boolean fields in <field name="my_field" attrs="{'invisible': [('boolean_field','=',False)]}" </field>

chirag jogi
on 4/27/15, 10:22 AM 1,045 views

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

 Plz help..

Thanks in advance


Jérémy Kersten (jke)

--Jérémy Kersten (jke)--

| 3 3 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 4/27/15, 12:16 PM

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)]}" /> 

Brijesh Kesariya
On 7/9/15, 8:13 AM

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)] )

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.


Odoo Training Center

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

Test it now

Question tools

1 follower(s)


Asked: 4/27/15, 10:22 AM
Seen: 1045 times
Last updated: 7/9/15, 9:01 AM