Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
5513 Zobrazení

Hi,

I would like to hide a menu to a specific group even if this group has access to the model called by that menu. 

(access is currently set to all permissions: 1, 1, 1, 1)

So far I have tried this solution but it does not work:

<record id="module.target_menu" model="ir.ui.menu">
<field name="groups_id" eval="[(3,ref('model.my_target_group'))]"/>
</record>


Any idea? Is it possible anyway?

Avatar
Zrušit
Nejlepší odpověď

you can hide a menu from a specific group in Odoo:

  1. Identify the ID of the menu you want to hide. You can find the menu ID by inspecting the HTML source code of the menu in Odoo's backend or by looking at the module that defines the menu.

  2. Create a new module or locate an existing module where you can define the menu modification.

  3. In your module, create a new XML file (e.g., data.xml) and add the following code

odoo>
data>
record id="your_module.target_menu" model="" rel="ugc">ir.ui.menu">
field name="groups_id" eval="[(5, 0, 0), (4, ref('model.my_target_group'))]"/>
/record>
/data>
/odoo>

In this code, replace your_module.target_menu with the appropriate ID of the menu you want to hide.

  1. In the groups_id field, use the following evaluation codes:

    • (5, 0, 0) to remove all existing groups from the menu's access rights.
    • (4, ref('model.my_target_group')) to add the reference to the specific group you want to hide the menu from. Replace model.my_target_group with the appropriate ID or XML ID of your target group.
  2. Install or upgrade your module containing the XML file.

After completing these steps, the menu should be hidden from the specified group, even if the group has access to the underlying model. The menu will only be visible to users who belong to groups explicitly specified in the groups_id field of the menu record.

Avatar
Zrušit
Nejlepší odpověď

Hi,
Please refer the below app

 https://apps.odoo.com/apps/modules/16.0/hide_menu_user/

Hope it helps

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
úno 23
2319
2
zář 19
4396
1
čvc 19
5295
4
říj 20
31725
3
led 24
12607