Enable Dark Mode!
By: Abdul Afras

How to Create a Security Group in Odoo 13

Technical Odoo 13 Sales

In any business management, we have many users who have different responsibilities and rights. So, not all the functionalities should be displayed to all the users. In the case of Odoo Sales Management, the administrator can see all the sales but a salesman can see only his sales. This is done by using security groups. The administrator has a security group as well as a salesman. We can define record rules based on the security groups. Also in Odoo, we can specify the groups to menu or fields for which the menu or field will be displayed for that particular security group. 

In this blog, I will create the security groups for my custom module overtime

Firstly, I will create two security groups, one is for the manager and another one is for the user. 

The Manager will have full rights but the user will have only limited rights.

Make an XML file under the security directory to add the security groups. 

         <record model="ir.module.category" id="module_management">
             <field name="name">Overtime</field>
             <field name="description">User access level for Overtime module</field>
             <field name="sequence">20</field>

This will create an option in the user’s form with the name Overtime. We need to add the security group so that the user can select the access rights.

         <record id="overtime_user" model="res.groups">
            <field name="name">User</field>
            <field name="category_id" ref="module_management"/>
        <record id="overtime_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="category_id" ref="module_management"/>
            <field name="implied_ids" eval="[(4, ref('overtime_user'))]"/>

This code will create a security group for both the user and the manager

When creating the user’s group we are only mentioning the name of the security group and the category_id to which they belong. We have already created the category above so we need to give the id of the category. When it comes to the manager we are giving the name and the category id like the user but we have also given the implied_ids, That is, the implied id for the user security group. This means the manager will also have the rights that are given to the user. 

So if you go to general settings, on debug mode under the Users & Companies menu item you can see a menu item called Groups

Under the groups, we can see all the security groups that have been created. We can also see the security group that we created just now.


Besides, in the user’s settings, we can see the two groups displayed under the category Overtime and we can choose the security group for the users.


We can also add the groups to the Menu item. Sometimes we don’t want to see some of the menu items for the users. We can specify the group for which we want to display the menu item by adding groups to the Menu item. 

        <menuitem name="Overtime"

So the users with the security group overtime_manager will only see the menu item.

Now we have a model and we have a security group. Next thing we have to do add ir.model.access.csv file under security. 

access_admin,Access Manager,model_overtime_overtime,overtime_user,1,1,1,0
access_user,Acess user,model_overtime_overtime,overtime_manager,1,1,1,1

To know more about security you can see our Blog Security in Odoo.

If you need any assistance in odoo, we are online, please chat with us.


Leave a comment




Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635



Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.



Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message