This question seems to have been asked before, but I couldn't get the answers to work.
I have a field - amount_words. It should be invisible only to one group and visible to all others. This is what I have done so far:
<record id="view_order_line_tree2" model="ir.ui.view"> <field name="name">sale.order.line.tree.inherit</field> <field name="model">sale.order</field> <field name="inherit_id" ref="sale.view_order_form"/> <field name="arch" type="xml">
<xpath expr="//page/group" position="after"> <group class="oe_subtotal_amount_footer oe_left"> <field name="amount_words" /> </group> </xpath> </field> </record>
This is to introduce the amount_words field.
Now, to hide it for the service_order group:
<record id="view_order_line_tree3" model="ir.ui.view"> <field name="name">sale.order.line.tree.inherit2</field> <field name="model">sale.order</field> <field name="inherit_id" ref="view_order_line_tree2"/> <field name="groups_id" eval="[(6, 0, [ref('custom_sale.group_service_order') ])]"/> <field name="arch" type="xml"> <field name="amount_words" position="attributes"> <attribute name="attrs">{'invisible':1}</attribute> </field> </field> </record>
But the effect is that it is now invisible for all groups. Does anyone know how to achieve this?