This question has been flagged
2 Replies
3322 Views

I would like to hide the "notify_email" and "opt_out" field in the Customers/Sales & Purchases page on the Sales column after  "Sales Person" but not successful after many trials.

The "notify_email" and "opt_out" were listed in mail.view_emails_partner_info_form. Here's my code to hide "notify_email" field:

<?xml version="1.0" encoding="utf-8" ?>
<openerp>
     <data>
         <record id="hago_view_emails_partner_info_form" model="ir.ui.view">
             <field name="name">hago.res.partner.emails.info.inherit</field>
             <field name="model">res.partner</field>
             <field name="inherit_id" ref="mail.view_emails_partner_info_form"/>
             <field name="arch" type="xml">
                 <xpath expr="//field[@name='notify_email']" position="attributes">
                     <attribute name="invisible">1</attribute>
                 </xpath>
             </field>
         </record>
     </data>
</openerp>


I got the following error:

ParseError: "Invalid view definition

Error details:

Field `notify_email` does not exist

Error context:

View `hago.res.partner.emails.info.inherit`

[view_id: 727, xml_id: hago.hago_view_emails_partner_info_form, model: res.partner, parent_id: 257]

None" while parsing /home/simonlee/workspace/odoo9/customaddons/hago/views/hago_view.xml:4, near

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

<field name="name">hago.res.partner.emails.info.inherit</field>

<field name="model">res.partner</field>

<field name="inherit_id" ref="mail.view_emails_partner_info_form"/>

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

<xpath expr="//field[@name='notify_email']" position="attributes">

<attribute name="invisible">1</attribute>

</xpath>

</field>

</record>

Please advise what I did wrong and how to hide "notify_email" and "opt_out" field. Thanks.

Regards,

Simon Lee

Avatar
Discard
Author Best Answer

@Nilesh

Try your suggestion but get the same error.

Simon

Avatar
Discard
Best Answer

Hello,

Please add the below line after <field name="model">res.partner</field>

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

and then try to upgrade module. 

Avatar
Discard