Company Hub — Multi-Company Selector
Company Hub gives an ERPNext v16 group an Odoo-style company selector without modifying Frappe or ERPNext core. A user selects an authorised company in the Desk navbar, the selection becomes their native company default, and new transactions automatically start in that company.
The app has two deliberately separate controls:
- Company User Permissions are the security boundary. They restrict list queries, reports, document access, and direct URLs on the server.
- Company Workspace Profiles are the user experience. They decide which workspaces appear while a company is active.
Hiding a workspace is not a security control. Always configure User Permissions before relying on the workspace profile.
Before you start
- Install
ecosire_company_hub, ERPNext v16, andecosire_license_client. - Create every operating and holding company as a normal ERPNext Company.
- Sign in as System Manager.
- Confirm the ECOSIRE licence is active.
1. Grant company access
For each restricted user, create one or more native User Permission records:
- Open User Permission and create a new record.
- Set User to the staff member.
- Set Allow to Company.
- Set For Value to an operating company the user may access.
- Save and repeat only for the other companies that user needs.
Management users who genuinely require unrestricted consolidated access can remain without a Company User Permission. Review that exception carefully; it grants access across the group.
2. Configure workspace profiles
Create one Company Workspace Profile for each company:
- Select the Company.
- Leave Enabled checked.
- Add the workspaces relevant to that business in Visible Workspaces.
- Save and reload the Desk.
Home and Users remain visible. An empty or disabled profile does not filter
the Desk, but server-side User Permissions still apply.
For a holding company, select Is Group Company. Its authorised management users receive an unfiltered workspace view for consolidated work.
3. Switch companies
Users who can access more than one company see the selector in the navbar:
- Open the company selector.
- Choose an authorised company.
- Let the Desk reload.
- Confirm the company name before creating a transaction.
The app stores the choice as Frappe's per-user company default. Sales
Invoices, Purchase Orders, Journal Entries, and other company-owned documents
therefore use ERPNext's normal defaulting behavior.
List views receive a removable default company filter. Opening a document from another active company raises a non-blocking warning; access is still decided by the server-side permission.
Security verification
Test with a non-administrator account:
- Switch to each authorised company and confirm its expected workspaces.
- Create a draft transaction and confirm the Company default.
- Search for a record belonging to an unauthorised company.
- Try its direct URL and a report that includes Company.
- Confirm every unauthorised path is denied, not merely hidden.
If an unauthorised record is visible, fix the User Permission configuration before go-live.
Troubleshooting
| Symptom | Check |
|---|---|
| Selector is not visible | The user must be authorised for more than one company |
| Wrong workspaces appear | Check the active company's enabled Workspace Profile |
| New documents use the wrong company | Switch again and confirm the user's Company default |
| User can access another company's records | Fix Company User Permissions immediately |
| Profile change is not visible | Reload the Desk; saving a profile clears the relevant cache |