Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7392 Lượt xem

Hi everyone, so I have a menu item that I only want to be visible for group A and group B.

I know there is a "groups" attribute for menuitem but I am only able to pass it the name of a single group. I haven't been able to find any documentation or examples on how to pass it a list of groups.

I'm sure that there's a way to allow multiple groups to access a menuitem (and corresponding action), if anyone could explain it to me I'd be very grateful.

 

Ảnh đại diện
Huỷ bỏ

Are you managing a multi-company setup in Odoo and need company-specific user access and menu visibility?

This Multi-Company User Group & Menu Access Manager allows you to assign user groups per company and dynamically control menu visibility based on selected companies.

With this app, you can:
-Assign Different User Groups for Each Company
-Automatically Update User Groups on Company Change
-Show/Hide Menus Based on User Groups & Company Selection
-Prevent Admin Users from Losing Super Access
-Seamless Multi-Company Management Without Manual Effort
https://apps.odoo.com/apps/modules/18.0/mh_multi_company_access_rights

Câu trả lời hay nhất

Yes, you can pass multiple groups in the menu by separating them "," (comma) in the XML file.

menuitem name="My Menu" id="menu_custom"         groups="my_module.group_a,my_module.group_b"        

Here is the live example from v15: https://github.com/odoo/odoo/blob/15.0/addons/account/views/account_menuitem.xml#L6

Ảnh đại diện
Huỷ bỏ
Tác giả

You're right! I had tried that before, my real error was actually hidden in the permissions file!
Thanks :)

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 24
1338
1
thg 2 24
2068
0
thg 5 15
4696
2
thg 7 23
5685
2
thg 3 24
5813