Custom DocType in Multi Tenant

Hi,

I have configured a multi tenant environment,

actually I have 2 sites:

cp1.mysite.com (the first one)

cp2.mysite.com

On my bench folder I can see the 2 sites and just the 2 apps (frappe and erpnext), so I think that the erpnext app is the same for the 2 sites (right ?)

On cp1.mysite.com with the Admin I have created a Custom DocType.

If I have understood correctly, in multi-tenant the configuration between sites is shared, so I expect do access to all my custom DocTypes in all sites, but it’s not working.

From cp2.mysite.com I can’t see the Custom DocType.

Is there any particular configuration to do to allow custom DocType sharing between sites?

Hi @cbasso

All customizations (custom doctypes, custom fields …) belongs to site (stored in database), not to the app.
Multitenancy configuration is irrelevant here.

Hope this helps.

Ok, so if I want to build custom DocTypes and provide a multi company/tenant environment (the need is to avoid user from company1 to access any data of company2), what is the best architecture?

Thanks

I think you need to put it on github and then install and update in each site seperately
The objective behind sites is isolation - even at the db level
What is shared is the bench/python/node versions

Ok, thanks for the clarification.

If you want your custom DocTypes available on multiple sites, the recommended way is to put them in a custom app and install that app on each site. That way, the DocTypes are shared, but the data stays isolated per tenant.

See here: https://docs.frappe.io/framework/user/en/tutorial/create-an-app