How to restrict Customer visibility by Company in ERPNext v15 (Multi-company setup)

ERPNext Version

  • ERPNext: v15.62.0

  • Frappe Framework: v15.x

  • Deployment: (Self-hosted / Frappe Cloud – bạn có thể bổ sung nếu muốn)


Problem Description (Core Issue)

I am using ERPNext in a multi-company setup with two companies:

  • Company A

  • Company B

In ERPNext, Customer is a global master and is not linked directly to a Company.
This creates a challenge for data isolation and internal access control.

:backhand_index_pointing_right: Core requirement:

How can I ensure that employees of Company A can only see Customers belonging to Company A,
and employees of Company B can only see Customers belonging to Company B?


What I Have Tried

  1. Role Permissions

    • Restricting access by Company

    • Result:

      • Works for transactions (Sales Order, Invoice)

      • :cross_mark: Does NOT restrict Customer list visibility

  2. Sales Person + User Permission

    • Assigned Sales Person to Customer (Sales Team)

    • Added User Permission on Sales Person

    • Result:

      • :cross_mark: Users can still see all Customers in the Customer list
  3. Sales Territory

    • Used Territory to represent Company

    • Assigned Territory to Customer

    • Result:

      • :cross_mark: Territory does not restrict Customer visibility
  4. Customer Portal Users

    • Considered using portal users

    • Conclusion:

      • :cross_mark: Portal Users are for external customers, not internal staff

Strange … i tried territory and its works for me… what did not work for me was Company

I think your exact situation is described in User Permissions and thats what this function was created for

If you want I can send you photos