Skip to Content
Menu
This question has been flagged
2 Replies
3315 Views

Hi everyone,

i'm newbee and i need help about security and groups in Odoo 12. Pls help me !!!

Thank u guys :D

Avatar
Discard
Best Answer

Hi,

You can give groups attribute along with the menu item, so that the menu will be visible only for users in the group.

As a newbie if you want to understand how the Odoo security mechanism work in details, see this: Access Control, Record Rules and Group

<menuitem id="res_partner_menu_config"
name="Configuration"
parent="menu_contacts"
groups="base.group_system"
sequence="2"/>

So the above will be only visible for the users in the group base.group_system .

For you as user don't want to see anything in his login, you can remove the users from all groups by opening the users form view(so that he will only see discuss and employee).

Thanks

Avatar
Discard
Best Answer

Adding a group to an existing menu is done via the normal Odoo record  update mechanism. you just declare a <record> with the same ID, with only a value for the groups_id field:

<record id="original_module.menu_id" model="ir.ui.menu">
        <!-- Use the special many2many value syntax to add a child record,
             and the `ref()` method to resolve the group XML ID -->
        <field name="groups_id" eval="[(4,ref('my_new_group_id'))]"/>
</record>

Avatar
Discard

Its a good method