Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3326 มุมมอง

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


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Hey many thanks !!
Will try this !

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 22
1680
0
ม.ค. 21
2019
Sales Managers over Sales Users แก้ไขแล้ว
2
พ.ค. 19
5052
Dynamic Form from Tree View แก้ไขแล้ว
3
ส.ค. 20
4068
1
ธ.ค. 20
4936