Odoo Help

Welcome!

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

1

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

By
chirag jogi
on 4/27/15, 10:22 AM 573 views

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


 Plz help..

Thanks in advance

4

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--
2993
| 3 2 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)]}" /> 

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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