Multitenancy

Hi,
You can’t rely a domain (eg: Partner) to a decicated db. The internal Hibernate management in the ADK do not includes this kind of features.

If you want to split your application for several organizations (companyA just see CompanyA data), you just have to use a custom role with custom permissions and its associated condition.

What are your fonctionnal requirements ?

Hi, thanks
yeah i want to separate application by company, user of company A user see all the data of company A : ex - Product List, Project List, Stock Move, Stock Quantity , Suppiler … Only Data of Company A.
Thanks

OK, this is what i’m done to make it possible without having several db:

  1. Create your own module
  2. Declare a domain user.xml and just add a M2O field to the Axelor User entity (override

<module name="auth" package="com.axelor.auth.db"/> <entity name="User" sequential="true" lang="java"> <many-to-one name="organization" ref="com.axelor.apps.base.db.Partner"/> </entity>
3. Override the view/user.xml form to add you Partner field
3. Assign the partner (your org) to each user
4. Change de permissions and add the condition "self.createdBy.organization = null || self.createdBy.organization = ?" and its param "__user__.organization"

Now, each user will onyl see objects created by the same org.

thank so much for supporting

I have the same question with gengulay . How we can create new database tenancy without run axelor web with default database at the first one ?

thanks

Hi,

I think the better way is to clone the main database (not used in multi tenancy mode) and add config in application.properties.

Hi
I tried this multy tenant setup, but it does not work for me. ABS starts with lot of error messages, but is never ready to log in.
I tried to figur out errors in my setup, but can not find a difference to the config.
Does it work for anybody?

Thanks