Hello all, i'm trying to override a button which using type="action".
Original Button:
<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" context="{'default_advance_payment_method': 'percentage'}" data-hotkey="q"
attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
I'm trying to inherit it with usual way which is use @name= .. like this:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="sale_order_view_form_create_contract_button" model="ir.ui.view" style="color:#e8bf6a;">>
<field name="name">sale_order_view_form_create_contract_button</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="priority" eval="100"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='%(sale.action_view_sale_advance_payment_inv)d']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
</odoo>
Unfortunately, It doesn't seem to work.
Please help, thanks you.