I’m trying to run a multi-company environment. Each company has his own data. There is no shared data between company but I want to share the customizations.
For example, if I add some doctypes I need these doctypes in all companies. The same for custom fields, translations…
Multi-tenant is the best way to go.
THis means that you have different sites that share the same bench directory (created by bench init command).
You have a common apps directory where the apps like frappe, ERPNext, and your own customizations exist.
You sites will share the same code base, but will be stored in different databases (same mariadb)
Multi-Company means you share one site for different companies. This means that the Companies have the possibility of accessing common data (like items, warehouses, even employees., this is good for intra-company setups.
if you have an application where the customizations are totally different, you may also create separate frappe-bench directories, by issuing multiple bench init commands and placing the sites on these different frappe-bench directories (which have different names). THis allows you to share the same mariadb and the same server (or VPS), but have totally different and independent application setups.
Create an app and create seperate instances for your companies.
Transactions has company field which you can create permissions but Items/Customers/Suppliers doesn’t have a company field. You need to add it and create permissions for that. But then reports and other things will get harder to customize.
I would recommend the first one. You also need to search in the forum. Each week I came across a similar post.
Just a small question here: when multitenant is used, it has same app as stated by everyone here. So does it mean that if i make a customization in one site it would also be applied to all the sites / companies hosted using the multitenant option?
when you do bench install-app into the different sites. All those different sites will share the same code base of the apps stored at the apps subdirectory of the frappe-bench directory.
Customization done on the front end of a particular site - ends up only in the database of the particular site - at the moment. However when you use use fixtures and hooks, all the sites in the frappe-bench directory will share those Customizations.
This is an important note. When you do add custom fields, write custom scripts, or add DocType with a checked Custom checkbox in the front end of a particular site (company), these customizations are stored only in the database. So, it will affect only the particular site.
To share these customizations, you use export fixtures and hooks, and the sites in that frappe-bench folder will have those same custom codes, fields, and doctypes.
However, the “customizations” you coded directly to your own app will be shared by the sites.
As @TurkerTunali mentioned, not every ERPNext table (DocType) is separated by a “Company”. Some big outliers are:
Customers
Suppliers
Items
For this reason (and a few others, related to roles and permissions), the “Multi Company” feature of ERPNext has its limits. It’s not as robust as something like MS Dynamics, which automatically splits every SQL table, per company.
As others have mentioned, this means that Multi-Tenant (aka multi-site), or Multi -Instance/Server may be the best approaches for separating data by legal entity.