Reputation: 2186
What is the best solution to hide field eg. partner_id in
<xpath expr=".">
<field name="partner_id" />
</xpath>
Upvotes: 5
Views: 1830
Reputation: 11141
Alternative way with more details to make field invisible, readonly etc at once based on specific condition.
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="attrs">{'invisible': [('field_name', 'Operator', Value)],
'readonly': [('field_name', 'Operator', Value)]}
</attribute>
</xpath>
Upvotes: 2
Reputation: 14746
Another way which you can implement is
<field name="partner_id" position="replace">
<field name="partner_id" invisible="1" />
</field>
This is just an alternate of above solutions.
Upvotes: 1
Reputation: 1841
This is the best way of hiding any field from the view.
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
Upvotes: 4
Reputation: 2358
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
Upvotes: 6