Hide field in xpath exp odoo 9

What is the best solution to hide the field, for example. partner_id in

<xpath expr="."> <field name="partner_id" /> </xpath> 
+5
source share
4 answers
 <xpath expr="//field[@name='partner_id']" position="attributes"> <attribute name="invisible">1</attribute> </xpath> 
+6
source

This is the best way to hide any field from the view.

 <xpath expr="//field[@name='partner_id']" position="attributes"> <attribute name="invisible">1</attribute> </xpath> 
+3
source

Another way you can implement is

 <field name="partner_id" position="replace"> <field name="partner_id" invisible="1" /> </field> 

This is just an alternative to the solutions above.

0
source

An alternative way with more details on making the field invisible, readonly, etc. simultaneously based on a 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> 
0
source

Source: https://habr.com/ru/post/1270008/


All Articles