Odoo Help


make a many2one field invisible when is empty

Giovanny Vizcaya
on 3/17/16, 11:45 PM 1,333 views


i'm triying to make invisible a one2many field when it hasn't some data in the field... i tried with

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

but that makes it invisible as same way invisible="True".

How can i solve it?

Jignesh Mehta
On 3/18/16, 3:01 AM

Hello Giovanny,

Remove quote from False

Try this :-

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

Hope it works for you.


Doesn't work... same problem... i need it visible when create a new employee, and after saving, if field is empty becomes invisible

Giovanny Vizcaya
on 3/18/16, 10:40 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.


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: 3/17/16, 11:45 PM
Seen: 1333 times
Last updated: 3/18/16, 3:01 AM