İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
3589 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici En İyi Yanıt

Hey many thanks !!
Will try this !

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
May 22
1891
0
Oca 21
2282
2
May 19
5310
3
Ağu 20
4371
1
Ara 20
5218