Skip to Content
Menu
This question has been flagged
1 Reply
2640 Views

Hi all, Can we add more than two user type (Manager and User)?. Now I want to create User Types like that (Manager , Supervisor and User)in Project Module. But Odoo have only two(Manager and user). I already tried but can't . Please help me. our help is highly appreciating.Thanks.

Avatar
Discard
Best Answer

Hello there, 

Yes you can add more than two user type (Manager and User). 

You can add supervisor group like mentioned below

<record id="group_project_supervisor" model="res.groups">

    <field name="name">Supervisor</field>

    <field name="category_id" ref="base.module_category_operations_project"/>

    <field name="users" eval="[(4, ref('base.user_root'))]"/>

    <field name="implied_ids" eval="[(4, ref('project.group_project_user'))]"/>  

</record>

You also need to update manager group

<record id="project.group_project_manager" model="res.groups">

        <field name="implied_ids" eval="[(4, ref('group_project_supervisor'))]"/>

</record>


Thanks

Anisha Bahukhandi

Technical Content Writer

Avatar
Discard
Author

Thanks Anisha , I will try now

Author

hello anisha,

Here is my code and May I add next group. Please help me.

<record model="ir.module.category" id="module_category_project">

<field name="name">Project Management</field>

<field name="description" >Category for Project</field>

<field name="sequence">45</field>

</record>

<record id="group_project_user" model="res.groups">

<field name="name">User</field>

<field name="category_id" ref="module_category_project"/>

</record>

<record id="group_project_manager" model="res.groups">

<field name="name">Manager</field>

<field name="category_id" ref="module_category_project"/>

<field name="implied_ids" eval="[(4,ref('group_project_user'))]"/>

</record>

<record model="ir.rule" id="patient_record_rule">

<field name="name"> See Only his Tasks</field>

<field name="model_id" ref="model_project_task"/>

<field name="domain_force">[('user_id','=',user.id)]</field>

<field name="groups" eval="[(4,ref('group_project_user'))]"/>

</record>

<record model="ir.rule" id="patient_manager_record_rule">

<field name="name"> See all Tasks</field>

<field name="model_id" ref="model_project_task"/>

<field name="domain_force">[]</field>

<field name="groups" eval="[(4,ref('group_project_manager'))]"/>

</record>

</odoo>

Hi,

Yes if you want to manage Supervisor group then you need to add this group as well

<record id="group_project_user" model="res.groups">

<field name="name">User</field>

<field name="category_id" ref="module_category_project"/>

</record>

<record id="group_project_supervisor" model="res.groups">

<field name="name">Supervisor</field>

<field name="category_id" ref="base.module_category_project"/>

<field name="implied_ids" eval="[(4, ref('project.group_project_user'))]"/>

</record>

<record id="group_project_manager" model="res.groups">

<field name="name">Manager</field>

<field name="category_id" ref="module_category_project"/>

<field name="implied_ids" eval="[(4,ref('group_project_supervisor'))]"/>

</record>

Author

Thanks Anisha. Could you kindly check my code for supervisor and give advice how can i filter in domain_force for supervisor.

<record model="ir.rule" id="project_record_rule">

<field name="name">See Only his Project and Tasks only</field>

<field name="model_id" ref="model_project_task"/>

<field name="domain_force">[('user_id','=',user.id)]</field>

<field name="groups" eval="[(4,ref('group_project_supervisor'))]"/>

</record>

It seems that it is correct. For more queries and assistance in deep, you can mail at support@webkul.com

Related Posts Replies Views Activity
3
May 20
2491
0
Apr 20
2289
1
Apr 20
2347
2
Apr 20
1956
3
Mar 20
2156