1
votes

I have installed HR module and created following record rules on hr.employee model to make employee to access their own details.

Object: Employee
Apply for Read: checked
Apply for write: checked
Apply for create: checked
Apply for delete: checked
Rule Definition: [('user_id', '=', user.id)]

When employee apply leave from leave management module it display following Error

AccessError

The requested operation cannot be completed due to security restrictions. Please contact your system administrator. (Document type: hr.employee, Operation: read)

1
What is your purpose, making this rule?Hardik Patadia
I added this record rule to make employee to access his own details in HR employee list.Shravy
try to add more details,, you want the employee to see only his requests ? or what ?Mostafa Mohamed

1 Answers

0
votes

You have rule on the Group hr.employee which state that [('user_id', '=', user.id)] i.e. Employees can not see other Employees. Due to this access rule, Access Error Warning is being raised.

Try to find Send Email Function in hr.holidays. This function extracts Employee's Mangers Email ID to send Leave approval Email. But due to this Access Rule, you are not allowed access Manager's Email Id as Manager is also an Employee.

So I made a little change in Send Email function, and extracted Manager's Email ID as a Super User. Super user by-passess Access Rights.