In Odoo, you can have one database for multiple companies.
One common type of multi-company setup is to have a “parent-child” relationship between companies.
Odoo 12 (and earlier versions)
Navigate to Settings / Companies
Once this is enabled, Odoo will (generally) allow users in the parent company to view data in the “child” company, but not allow users in one “child” company to view data in another “child” (or “sister”) company.
However, it is strongly recommended that you check this in key areas of Odoo that you plan to use, because it does not apply universally (and you may not want that).
This is enforced by Record Rules, so you will need to understand the way that these work.
- The good news is that this gives you some flexibility
- The bad news is that it can be a little complex to understand how Record Rules interact with each other.
Multi-company Record Rules
Here are a few of the multi-company record rules in Odoo 12:
The important part here is the domain
['|', ('company_id','=',False), ('company_id','child_of',[user.company_id.id]) ]
The logic is that a user can access:
- Records with a blank company code
- Records in the “children” of the current company
- this includes the current company itself
Some are a bit different:
['|','|', ('company_id.child_ids','child_of',[user.company_id.id]), ('company_id','child_of',[user.company_id.id]), ('company_id','=',False) ]
This adds access to records in the parent company.
This rule applies to Contacts (res.partner), so customers and suppliers in the parent company will be available in the “child” company. If this is not what you want, you can amend this Record Rule.
Odoo 13 includes some big changes to multi-company.
This includes the removal of the “parent-child” logic, and its replacement with something more flexible. For many organizations this will be a good solution, but it does not support all scenarios. For example, the following could be problematic:
- A parent-child relationship (with shared data) PLUS separate companies (in the same database) that do not share share data.
- More than one parent-child relationship (Company A is parent of companies B & C, Company D is parent of companies E & F).
The above scenarios would probably be OK if there are different users for each groups of companies, but some extra configuration (or development) would be required if users need to be able to have access to multiple groups of companies.
- It may be possible to replicate the parent-child structure by adding Record Rules.