I want to add the item action_invoice_cancel
(Invoice Cancel) button in the customer invoice
. My aim is to see that button only for the users in the sale_manager. I tried like this:
Code
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="orchid_invoice_cancel_request_inherit" model="ir.ui.view">
<field name="name">invoice_cancel_request</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<button name="action_invoice_cancel" position="after">
<button string="Cancel Request" type="object" name="cancel_request" attrs="{'invisible':[('state','not in',('open','paid'))]}"/>
</button>
<field name = "move_id" position="after">
<field name = "od_cancel_reason" />
</field>
<button name="action_invoice_cancel" position="replace">
<button name="action_invoice_cancel" type="object" states="draft,proforma2,open" string="Cancel Invoice" groups="base.group_no_one,sales_team.group_sale_manager"/>
</button>
</field>
</record>
</odoo>
But its not working. What to do? Thanks in advance.