Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to hide the "notify_email" field in mail.view_emails_partner_info_form view

By
Simon Lee
on 4/8/16, 12:11 AM 271 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

0
Simon Lee
On 4/8/16, 1:39 AM

@Nilesh

Try your suggestion but get the same error.

Simon

0
Nilesh Sheliya
On 4/8/16, 1:33 AM

Hello,

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

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

and then try to upgrade module. 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/8/16, 12:11 AM
Seen: 271 times
Last updated: 4/8/16, 6:21 AM