ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Multiple Companies on single instance


#1

Hi,

I wanted to explore the possibilities of 8 to 10 companies on a single instance so installed V11 staging to test multiple companies. With user permissions, I was able to limit one user to a particular company but I also want to limit the items list and customers list to that particular company. I guess there is possibility but I am not sure of the issues that may arise. Maybe, there will be more work.

Need a suggestion whether to go ahead with multiple companies in single instance or multi-tenant.


#2

You’ll have to have a multi-tenant setup for that.


#3

that’s not how ERPNext works. Items, Customers, Suppliers are always available for all companies on the same instance. So, the multicompany scenario is not able to separate everything. As mentioned by @LifeP you can only achieve that in separate instances (which can live on a single installation of ERPNext though, the so called multi-tenant setup)


#4

@LifeP @vrms Thank you. will try with multi-tenant.


#5

You can also add company custom field in any doctype e.g. Item and set user permissions.


#6

This worked. Thanks…


#7

can any of you describe in detail how this works?


#8

Added a custom field named Company in the item and linked to Company doctype. When adding an item, selected a company. So, a user with permission to that particular company is only able to see that item. Same with Customer also.


#9

@Prasanna_CSA and @schilgod another alternative is to set value of permission in User Permission for Company Variable. And then setup a query filter for the same. But again thats a programatic way to do it. Alternatively if we apply to all roles of the users and also enable apply user permissions it should do the job. Something similar to what @Prasanna_CSA has suggested.

I agree with @vrms that thats now how ERP works. But cross cutting data hiding is required by many users (say by territory, branch, etc) and similar approach should also work for company level hiding.

Hope this helps.


#10

I think erpnext is not designed for having multiple companies on the same instance. The complexities of permissions, restrictions etc will make your clients(each company) confused. And it will be error prone. Even maintenance by you as a system user will be a nightmare.
Also need to consider performance of server/system adding multi companies.

The solution provided above may solve some issues, but design vise i don’t think its a right solution.

Also, multi company in single instance may be workable if you yourself are managing two of your companies. But if you are creating these for your clients to use and you as a service provider, i think it will be a maintenance nightmare.

But i will let someone from the foundation to answer which way you need to take. Just shared my understanding.


#11

I just implemented a multi company setup on a single instance. All the companies have direct relationships and interchangeable and overlapping expenses so it made better sense to set it up that way. I’ve however faced severe challenges with permissions as there are several layers to go through to ensure the right user has the right permissions. I haven’t really seen much discussion about this so I’m having to fly solo most of the way. I am hoping someone who has successfully implemented this can share insights on how to make assigning user permissions simpler.


#12

This may be of interest!? Proposal to refactor user permission based on SAP's authorization object concept


#13

my user permission refactor PR is here
https://github.com/frappe/frappe/pull/6582,

it is a so big change PR, expect a very long time to get it finally merged,