This question has been flagged
1 Reply
3715 Views

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.

 

Avatar
Discard
Best Answer

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

Avatar
Discard
Author

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