Hierarchy Base Views in Leads

Is it possible to restrict access for Supervisor 1 & 2 to their Sale Persons only and Manager to see his child sales data only?

@Shivam.thaker yes, it’s fully possible!

But not without customizations!
You will need to create some query_permissions and has_permissions hooks into a custom app.

Frappe by default implement a plenty of those!
You can take a look into they


and here

1 Like

Can you explain more how i can do it ?? I am new to frappe

@Shivam.thaker first of all organize your “Sales Team” in the form of a hierarchy.

Sales Team

  • General Sales Manager
    • Sales Manager 1
      • Sales Person 1
      • Sales Person 2
      • Sales Person 3
    • Sales Manager 2
      • Sales Person 4
      • Sales Person 5
      • Sales Person 6

Add a user permission to associate the user with with his respective Sales Person
Add a custom link field on the Lead of type Link associated with the Sales Person doctype.

By default all sales persons only will be able to see what they have as his Sales Person
After to fix the Sales Managers and General Sales Manager permissions you can write the custom app.

To understand how to create custom apps in frappe follow this tutorial


One alternative to dont use code!

Instead of associate the Sales Managers with they Sales Person, associate they with an Territory.
Also Associate the Sales Persons under the Sales Managers, with that territory.

This will allow the Sales Person, only see they sales.
The Sales Manager to see all the Sales of the Territory
and the General Sales Manager to see everything.