Try ERPNext Buy Support Partners Foundation

Restrict Customer visibility based on Sales Person

Hello.

I need to get the Sales Team to the Apply Rule lists (screen shots attached below). What I am trying to achieve is, only the Sales Team assigned to the Customer should see that particular customer. And in some cases, one customer could be shared by multiple sales teams.

We have multiple sales teams at work. we do not want to share all the Customers list to the entire team. Only each sale team should see only the customer they are managing.

@Noushad_Moidunny

You can create a customer group and restrict your users(sales person) using user permission manager based on those groups.

@shachiTakalkar

May be I did not convey my question clearly!

Since we can clearly define the Sales Persons on each Customer master, can we not restrict the access based on Sales Persons. Is the sales person and user is not linked?

Below I have Customer named Akron linked to the sales person Kurian. Once Kurian logs in, he should see customers only he is linked to by Sales Person. If we add customer group to solve this issue, then we need to maintain that extra layer.

And if a customer is managed by multiple sales person, both of them should have access to it.

Linking Sales Person to Customers is not available as of now. You must add User Restrictions using User Permissions Manager.

Hello,

Though Sales Persons are specified in the Customer, but it’s in the child table. As per the current permission system, you can apply permission on the fields in the main form, and not in the child table. Perhaps you can add a Custom Link field on Sales Person in the main Customer form. Then you will be able to apply restriction based on Sales Person. However, this means that you will be able to select only one Sales Person per Customer.

https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/articles/creating-custom-link-field

1 Like

@shachiTakalkar @umair

Thanks for clarifying this. I created a custom filed for sales person in customer master and got it working. That’s the best solution for us because we have only 5 customers shared by multiple sales person. So there would be duplications of the same customers twice. Not a clean solution… :frowning:

I created a custom field for the sales person in “Customer”. I think my rules are OK but still, each user can see every clients but when they click on the client to see the details they will get an error message if they are not the linked sales person. That’s a good start but ideally, I would prefer if the user could only see its own clients in the client list…

What have I done wrong?

Thanks!

G.

@Noushad_Moidunny

You can restrict customer to particular sales person.
Solution
Go to User Permissions - http://localhost:8000/desk#Form/User%20Permission/New%20User%20Permission%201
image

Go to Role Permissions Manager, in "select document types’ , select and set “if customer is permitted”
http://localhost:8000/desk#permission-manager


image

Once above two steps are done, correct permission can be check at
http://localhost:8000/desk#query-report/Permitted%20Documents%20For%20User
image

1 Like

How to restrict for sales manager and sales person, hierarchically?

1 Like

Permission settings are slightly different from version to version. Perhaps you can state your current version so that the community can help you out.

There’s a field named ‘Accounts Manager’ in the Customer doc. You can try by putting individual salesperson’s email address in ‘Accounts Manager’ field