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 replace notebook page "Sales & Purchases" ?

By
Ahmed Hassan El-mawaziny
on 2/13/14, 5:16 PM 2,427 views

I want to hide "Sales & Purchases" page (tab), when i install my module it show me an error about mail and product views

for mail: AttributeError: View definition error for inherited view 'mail.view_emails_partner_info_form' on model 'res.partner': Element '<xpath expr="//field[@name='active']">' not found in parent view 'base.view_partner_form'

my view: <openerp> <data> <record model="ir.ui.view" id="partner_donorlocalpartner_form_view"> <field name="name">pmu.donorlocalpartner</field> <field name="model">res.partner</field> <field name="inherit_id" ref="base.view_partner_form"/> <field name="arch" type="xml"> <data> <field name="name" position="after"> <field name="pmu_partner_type"/> </field> <xpath expr="//notebook/page[@string='Sales & Purchases']" position="replace"> </xpath> </data> </field> </record> </data> </openerp>

0
Sajad KK
On 2/14/14, 12:25 AM

Try this for hiding sale&purchase:

<record model="ir.ui.view" id="partner_donorlocalpartner_form_view"> 
    <field name="name">res.partner.form.inherit1</field> 
    <field name="model">res.partner</field>
    <field name="inherit_id" ref="base.view_partner_form" /> 
    <field name="arch" type="xml"> 
        <data> 
            <field name="name" position="after"> 
                <field name="pmu_partner_type" /> 
            </field> 
            <xpath expr="//page[@string='Sales & Purchases']" position="attributes" > 
                 <attribute name='invisible'>1</attribute> 
            </xpath>
        </data> 
    </field> 
</record>

Thank you so much but it didn't work and not give me any errors

<record model="ir.ui.view" id="partner_donorlocalpartner_form_view"> <field name="name">pmu.donorlocalpartner</field> <field name="model">res.partner</field> <field name="inherit_id" ref="base.view_partner_form" /> <field name="arch" type="xml"> <data> <field name="name" position="after"> <field name="pmu_partner_type" /> </field> <xpath expr="//page[@string='Sales & Purchases']" position="replace" /> </data> </field> </record>

Ahmed Hassan El-mawaziny
on 2/14/14, 8:09 AM

Please if i can't replace it maybe i can hide it by css, is there anyway to inherit notebook page and add css class to it ?

Ahmed Hassan El-mawaziny
on 2/14/14, 10:57 AM

Thank you so much, its give me this error about prouduct View definition error for inherited view 'product.view_partner_property_form' on model 'res.partner': Element '<page string="Sales & Purchases">' not found in parent view 'base.view_partner_form'

Ahmed Hassan El-mawaziny
on 2/15/14, 3:16 PM
0

Finally the answer is

<xpath expr="//page[@string='Sales & Purchases']" position="attributes" >
    <attribute name="invisible">1</attribute>
</xpath>

Thank you so much for your help @sajadkk

glad to know your issue has been fixed, i updated my answer :-)

Sajad KK
on 2/16/14, 2:47 AM

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: 2/13/14, 5:16 PM
Seen: 2427 times
Last updated: 3/16/15, 8:10 AM