I have to hide the fields phone, mobile, and email in contacts, I believe I'm doing the right thing to do the trick but it seems that it's not behaving the way it should. Here's my code:
in inherited views..
<record id="contacts_custom_fields" model="ir.ui.view">
<field name="name">contacts.custom.fields</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="phone" position="attributes">
<attribute name="groups">module_name.group_admin,module_name.group_read_only</attribute>
</field>
<field name="mobile" position="attributes">
<attribute name="groups">module_name.group_admin,module_name.group_read_only</attribute>
</field>
<field name="email" position="attributes">
<attribute name="groups">module_name.group_admin,module_name.group_read_only</attribute>
</field>
</field>
</record>
I also tried this to locate exactly the field but, to no avail:
<record id="contacts_custom_fields" model="ir.ui.view">
<field name="name">contacts.custom.fields</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/group[1]/group[2]/field[@name='phone']" position="attributes">
<attribute name="groups">module_name.group_admin,module_name.group_read_only</attribute>
</xpath>
</field>
</record>
For a test, I also even tried to use: <attribute name="attrs">{'invisible': 1}</attribute> but to no avail
Anyone, who encountered the same issue.?