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

I have new group (Project Lead). This group need to Read others Project, and write his own project(ex: user1 is a manager in project001 and user2 is a manager in project002. We need user1  can edit project001 and he need to only read project002 not allowed to edit).

My below code did not work, Using the below code the all project changed into editable.

I have tried,

In XML

<record id="group_project_lead" model="res.groups">
<field name="name">Lead</field>
<field name="category_id" ref="base.module_category_project_management"/>
</record>
<record id="project_project_lead_rule1" model="ir.rule">
<field name="name">Project: Lead to view only others document</field>
<field name="model_id" ref="project.model_project_project"/>
<field name="groups" eval="[(4, ref('project_user_access.group_project_lead'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
<field name="domain_force">[('user_id','!=',user.id)]</field>
</record>
<record id="project_project_lead_rule2" model="ir.rule">
<field name="name">Project: Lead to write own document</field>
<field name="model_id" ref="project.model_project_project"/>
<field name="groups" eval="[(4, ref('project_user_access.group_project_lead'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
<field name="domain_force">[('user_id','=',user.id)]</field>
</record>

In CSV(Tried with CSV and also Without CSV)

access_project_project_group_lead,project_project_group_lead,project.model_project_project,project_user_access.group_project_lead,1,1,1,1


Avatar
Discard
Best Answer

What issue you are facing ?

Avatar
Discard
Author

When i using the access rule all the records are editable to all the managers, but manager need to only edit his own record.

Related Posts Replies Views Activity
0
Jun 16
2230
0
Jun 16
3329
0
Mar 15
2683
1
Dec 22
23148
2
Jun 20
1877