Skip to Content
Menu
This question has been flagged
2 Replies
3227 Views

Hi !

I'm looking for the correct group name to hide menu item "create invoice" button!
I'v tried to add a "group= " in the button field. 
It works and I can hide for everyone, but I want to restrict the access only to admin or better to the "sale administrator" group or to a custom group I've created : "sale accountant"

My last try was this, but not working :

<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"

                        group="sale.order.manager"

                        type="action" context="{'default_advance_payment_method': 'percentage'}"

                        attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>


does anyone has already done that ?


Thanks in advance


Avatar
Discard
Best Answer

Hi,

Seems you are facing issue to find the external id of the groups, for this what you have to do is  that activate the developer mode from the settings and navigate to Settings -> Users & Companies -> Groups, search for the group and open it.

Then click on the debugger button at the top right of the screen, near logged in user name, click on View Meta Data


Then from the next pop up, you can get the external id of this group.


So the group name for the Sales Administrator is: sales_team.group_sale_manager

If the groups are created from the user interface, it will not have external ID, in such cases, you can generate the external id by exporting the record one time.


Reference:

  1. Activate Developer Mode in Odoo

  2. How To Find External ID Of Records in Odoo

     3. How To Generate External ID For The Records Created From User Interface Odoo


Thanks

Avatar
Discard
Author Best Answer

Hey many thanks !!
Will try this !

Avatar
Discard
Related Posts Replies Views Activity
1
May 22
1651
0
Jan 21
1905
2
May 19
4965
3
Aug 20
4029
1
Dec 20
4845