This question has been flagged
2 Replies
2360 Views

HELLO

I use odoo 8 In tree view,I want annotations invisible to another employee.

Such employees can only see their own annotations, and managers can see all the annotation


1.name is annotation

<field name="name"/>


2.managers can see all the annotation,so I set managers to base.group_no_one

<field name="name groups="base.group_no_one"/>


But I don't know how to employees can only see their own annotations?


Thank you so much.

Avatar
Discard
Author Best Answer

HELLO I tested but faild.


I Write down the detailed steps

1.install Leave Management module

https://www.odoo.com/apps/8.0/hr_holidays/

2.change rule (Record Rule option in settings--> Technical --> Security --> record Rule)

it can lent everyone to see Leave information

Employee Holidays

[('employee_id.user_id','=',user.id)] to [(1,'=',1)]

Employee Holidays Create, Write, Unlink

[('employee_id.user_id','=',user.id)], ('state', 'in', ['draft', 'confirm', 'cancel'])] to[(1,'=',1)], ('state', 'in', ['draft', 'confirm', 'cancel'])]


I will lent employees can only see their own Description, and managers can see all Description.

3. I set managers to base.group_no_one and change form view and tree view

<field name="name"/> to <field name="name" groups="base.group_no_one"/>

I set mail.followers: read and write others entries of base.group_no_one 

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

but faild.



So Is there any way?

Avatar
Discard
Best Answer

Hi ,

 For that you need to write record rule for that group 

Ex: To view their own  annotations you need to write like this

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

Record Rule option in settings--> Technical --> Security --> record Rule

Avatar
Discard