Arges
Arges

Reputation: 23

How to hide a Many2one field without any dependecies?

I want to make a field invisible but without any other dependencies.

<field name="days_before" attrs="{'invisible': [('object', '=', '5')]}"/>

So without [('object', '=', '5')] Is there a way?

Upvotes: 0

Views: 61

Answers (2)

Haithem Bouhelais
Haithem Bouhelais

Reputation: 1

You can add invisible="1" in the xml file like:

<field name="field_name" invisible="1"/>

Also if you have inherited the view you can make an inherited field invisible without conditions by adding in the xml file:

<field name="field_name" position="attributes">
    <attribute name='invisible'>1</attribute>
</field>

Upvotes: 0

arryph
arryph

Reputation: 2825

Making a field invisible without any condition is much easier syntax.

<field name="days_before" invisible="1"/>

Same syntax works for readonly. Either value 1 or True can be used.

Upvotes: 1

Related Questions