Skip to Content
Menu
This question has been flagged
1 Reply
6755 Views

hello guys.. im using odoo 11 and  i want to hide button active/archive in product_product (product_normal_form_view) form view, I've been searching for it in product modules but i can't find which button for me to xpath it since it was inherited from product_template_form_view, can anyone help me? 


thank you :D

Avatar
Discard
Best Answer

Hi Rehan,

you can hide button from product using below code

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

    <field name="name">product.template.form.inh</field>

    <field name="model">product.template</field>

    <field name="inherit_id" ref="product.product_template_form_view"/>

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

        <xpath expr="//button[@name='toggle_active']" position="attributes">

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

        </xpath>

    </field>

</record>


Thanks & Regards
Urvisha
Caret It Solution PVT LTD

Avatar
Discard
Author

but i still want to show it on product template form view, i just dont want to show it on product_product form view..

Author

nvm you're right i just need to change it to product_product form view thanks!

Then you can write like this it will works

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

<field name="name">product.product.form.inh</field>

<field name="model">product.product</field>

<field name="inherit_id" ref="product.product_normal_form_view"/>

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

<xpath expr="//button[@name='toggle_active']" position="attributes">

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

</xpath>

</field>

</record>