Odoo Help


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.


How to make conditionally invisible a field with inheritance?

Juan Formoso
on 9/25/14, 11:18 AM 1,295 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!

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)


Asked: 9/25/14, 11:18 AM
Seen: 1295 times
Last updated: 3/16/15, 8:10 AM