Odoo Help

1

field attribute invisible with boolean do not work

By
Tomas Parnarauskas
on 7/17/13, 12:00 PM 10,021 views

I don't understand, why I can't use boolean field to hide/show another field. If I try this:

<field name="my_field"

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

Nothing happens. I can check boolean field and uncheck, , 'my_field' do not disappear.

But if try for example this:

<field name="my_field"

attrs="{'invisible': [('selection_field','=','2')]}"
 />

Then hide/show functionality of 'my_field' works fine. It disappears when I choose selection '2', and appears otherwise. I both selection and boolean fields from standard modules and from my modules. At both scenarios, if I use any selection field, it works, if I use boolean field, it does not.

6
Ray Carnes
On 7/17/13, 4:56 PM

You are comparing the value of boolean_field to the string 'False' which it will never be.

Do this instead:

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

Thanks. I don't know how I didn't see that :)

NOD Baltic, UAB, Tomas Parnarauskas
on 7/18/13, 2:43 AM

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

Question tools

0 follower(s)

Stats

Asked: 7/17/13, 12:00 PM
Seen: 10021 times
Last updated: 9/29/16, 10:59 AM