Skip to Content
Menu
This question has been flagged
4 Replies
3273 Views

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.

Avatar
Discard
Best Answer

You have specify to Group base.group_no_one,sales_team.group_sale_manager.

If you want that only sale manager can access it then you need to remove "base.group_no_one" group.

base.group_no_one is for developer mode. if you have specify 2 group and you are in developer mode and user is sale manager then that button will be visible.

Avatar
Discard
Best Answer

How can i use it for Odoo 11. And how to use that for cancelling the unwanted or undesired vouchers in general.

Avatar
Discard
Author Best Answer

@ Empiro: Thanks for the info on ` base.group_no_one`. I tried without it.But the button can be seen on other users. 
@Sushama : I will try and reply.
#
No karma for commenting

Avatar
Discard
Best Answer

Hi,

Try to add form sequence something like <field name="sequence">17</field> then check.

Avatar
Discard
Related Posts Replies Views Activity
1
Jun 17
2168
1
Jan 21
5646
1
Jun 15
3592
1
Apr 24
333
1
Sep 23
1024