Hierarchy Base Views in Leads

image
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

here

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

https://frappeframework.com/docs/v13/user/en/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.

3 Likes

Hey please can you guide me i have created territory, sales person tree everything but i am not able to archive this functionality… please guide me

what issue are you facing?

image
i created territory sale person everything but when i created any lead opportunity it is visible to all super visor.

any idea??

I will try to recreate this and see if it works for me.

thanks @Dishant_Shah

@nikita_sharma what’s the user permissions you have associated with your supervisors?

https://docs.erpnext.com/docs/v13/user/manual/en/setting-up/users-and-permissions/user-permissions

hey @max_morais_dmm that is i want to know how can associate