This question has been flagged
1 Reply
9871 Views

Hi, i have a problem to remove the 'action_quotation_send' button from the header of sale order form

<record id="view_order_form" model="ir.ui.view">
        <field name="name">sale.order.form</field>
        <field name="model">sale.order</field>
        <field name="arch" type="xml">
            <form string="Sales Order" version="7.0">
                <header>
                ....
                <button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
                <button name="action_quotation_send" string="Send by Email" type="object" states="sent,progress,manual" groups="base.group_user"/>
                ....

this is the code that I try to use to delete this two buttons from the header

<record model="ir.ui.view" id="view_order_form_ceo">
    <field name="name">view_order_form_ceo</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale.view_order_form"/>
    <field name="arch" type="xml">
        <data>
            <!--
            <button name="action_quotation_send" position="replace" />

            <xpath expr="/form/header/button[@name='action_quotation_send']"
            position="replace" />
            -->
            <button name="action_quotation_send" position="attributes">
                <attribute name="invisible">1</attribute>
            </button>
        </data>
    </field>
</record>

none of the three options work

what is the code to remove this buttons from the view!!! I'm going crazy trying to do that.

Avatar
Discard
Best Answer

Hi,

Try this will help you

 <button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="oe_highlight" groups="base.group_user" position="replace"/>
 <button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="oe_highlight" groups="base.group_user"  invisible="1"/>

     </button>
Avatar
Discard
Author

thank you for your help, your code have a mistake :P you need to remove "/" from " position="replace"/>"

regards