Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
1391 Vistas

Here is the code I have tried,

expr="//field[@name='email_from']" position="attributes">
name="invisible">1

 



Avatar
Descartar
Mejor respuesta

The email field can be shown in lead or opportunity, the below will hide it from both of them


 <record id="crm_lead_view_form_inherit_hide_email" model="ir.ui.view">


        <field name="name">crm.lead.view.form.inherit.hide.email</field>


        <field name="model">crm.lead</field>


        <field name="priority">15</field>


        <field name="inherit_id" ref="crm.crm_lead_view_form"/>


        <field name="arch" type="xml">


            <!-- to hide email from opportunity !-->


            <xpath expr="//group[@name='opportunity_partner']/label[@for='email_from']" position="attributes">


                <attribute name="attrs">{'invisible': 1}</attribute>


            </xpath>


            <xpath expr="//group[@name='opportunity_partner']/div" position="attributes">


                <attribute name="attrs">{'invisible': 1}</attribute>


            </xpath>


            


            <!-- to hide email from lead !-->


            <xpath expr="//group[@name='lead_info']/label[@for='email_from_group_lead_info']" position="attributes">


                <attribute name="attrs">{'invisible': 1}</attribute>


            </xpath>


            <xpath expr="//group[@name='lead_info']/div[2]" position="attributes">


                <attribute name="attrs">{'invisible': 1}</attribute>


            </xpath>


        </field>


    </record>


Avatar
Descartar