“reports_to” of all the employee working under the Team Leader is set to Team Leader’s id.
now the Team Leader can see the employee data of all the employee working under him (whose reports_to is set to TL’s id).
Now problem is TL can see the “Salary Slip” of all employee working under him.
because of reports_to set in the Employee master, when i remove this reports_to then salary slip is not visible
Anyone help, so that TL should see only his Salary Slip
Just so you know, the features we’re talking about are in version 14 or newer of ERPNext. I’m not super familiar with all the details, but I think you should look at the official guides or documentation to get a clear idea.
Create a Team Leader user permission for Salary Slips and check the ‘Hide Descendants’ option. This ensures that the Team Leader will not see the salary slips of employees who report to them.
@Rehan_Ansari no it will not solve the problem, i already did this
when i did this, then the TL sees all the Employee List data (who are in the same company), since you are particularly assigning the TL to see only Salary slip of his own, therefore all other data will be shown like Employee, Leave application, attendance request etc.
If he sees the data of only those who are working under him, whose “reports_to” field is set to this employee (TL), then only my issue will be resolved.
This is an issue with the reporting person being able to see his reporting employee’s documents irrespective of permissions being applied.
You could try to add other user permissions to documents that are unique to the TL but is also linked to the Salary Slip.
For example, you can map the salary structure assignment as a new link field in the salary slips and write a script that automatically fetches the salary structure assignment.
Then if you apply user permissions for the salary structure assignment (applied for all descendants), it should restrict the salary slips such that he’ll be able to see only his own.