Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
5835 Lượt xem

I want to hide task to other users, only assigned user can see the task and put timesheet in timesheet module. In timesheet module also show only assigned task instead of all.

Is there any solution for this issue

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

If you would like to visible task assigned user wise, then you have to implement security rule in project.task model
such as :

<record id="my_assign_task_rule" model="ir.rule">
<field
name="name">user: own task only</field>
<field
name="model_id" ref="project.model_project_task"/>
<field
name="domain_force">[('user_id','=',user.id)]</field>
<field
name="perm_read" eval="1"/>
<field
name="perm_write" eval="0"/>
<field
name="perm_create" eval="0"/>
<field
name="perm_unlink" eval="0"/>
<field
name="groups" eval="[(4,ref('base.group_user')),(4,ref('hr_payroll.group_hr_payroll_manager'))]"/>
</record>
Ảnh đại diện
Huỷ bỏ
Tác giả

After creating this rule, how can I restrict this rule to admin. I mean admin can see all task.

Can I hard code admin id in the domain ? to see all task

[('user_id','=',user.id)]

Câu trả lời hay nhất

Hello Dhivya,

@Saimon has given the correct way to see tasks for assigned users only.

Moreover, If you want to create/see your own timesheets you can assign a user to the "See own timesheets" group.

Thank you!

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hi Saimon, even though  created record rules, if I remove my task filter... I can see all task which are not assigned to me.


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Administrator (Super user) can see all task, even though the task not assigned to him,

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 20
4887
3
thg 4 16
17457
3
thg 8 15
8108
3
thg 3 15
4963
0
thg 3 24
1573