Odoo Help


How to make conditionally invisible a field with inheritance?

Juan Formoso
on 9/25/14, 11:18 AM 2,165 views

I am modifying a view through inheritance. I want to change an existing field and turn it invisible if other field values false. I know how to do it in the original module:

<field name="street" attrs="{'invisible':[('is_company', '!=', 'True')]}"/>

And I know how to make the field invisible from the view created by me, through inheritance:

<xpath expr="/form//field[@name='street']" position="attributes">
    <attribute name="invisible">1</attribute>

Anyone knows how to manage this? I would appreciate any help. Thank you in advance!

But what I need is to "mix" both options, something like this:

<xpath expr="/form//field[@name='street']" position="attributes">
    <attribute name="invisible">
[('is_company', '!=', 'True')]</attribute>

I will appreciate any help. Thank you in advance!

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: 9/25/14, 11:18 AM
Seen: 2165 times
Last updated: 3/16/15, 8:10 AM