Skip to content
Odoo Migration

Security and Access Control Considerations for Multi-Company Odoo Migrations

A practical guide to managing security, access rights, and data isolation during multi-company Odoo migrations, covering risk mitigation, testing, and cutover strategies.

12 min readSysGenPro Editorial
Security and Access Control Considerations for Multi-Company Odoo Migrations

Direct Answer: Securing Multi-Company Odoo Migrations

Securing a multi-company Odoo migration requires a rigorous approach to access control, data isolation, and permission validation. The primary risk is unintended data leakage between legal entities or unauthorized access to sensitive records due to changes in security models between versions. To mitigate this, organizations must perform a comprehensive audit of existing access rights, map them to the target version's security framework, and execute extensive testing in a representative staging environment. This process ensures that record rules, group permissions, and API access remain consistent, protecting business data and maintaining operational continuity. Key risks to control include broken custom security modules, deprecated API endpoints, and misconfigured cross-company access rights. By treating security as a first-class migration component rather than an afterthought, CIOs and IT directors can reduce the likelihood of post-migration security incidents and ensure compliance with internal and external regulations.

Pre-Migration Security Assessment and Audit

The foundation of a secure migration is a detailed assessment of the current security posture. Before any technical work begins, the IT security team must inventory all user groups, roles, and individual permissions. In a multi-company Odoo environment, this involves verifying how data isolation is currently enforced. Odoo uses a combination of Access Control Lists (ACLs) and Record Rules to manage visibility. ACLs determine which models a user can access, while Record Rules define which specific records within a model are visible based on criteria such as company ID. Auditing these configurations helps identify redundant permissions, overly broad access rights, and potential gaps in data segregation. This phase also includes reviewing third-party add-ons and custom modules that modify security behavior. Many custom modules introduce their own security rules or override standard behaviors, which may not be compatible with the target version. Identifying these dependencies early allows the project team to plan for code refactoring or replacement. Additionally, the audit should cover API integrations, ensuring that service accounts and tokens are documented and that their permissions align with the principle of least privilege. This baseline documentation serves as the reference point for all subsequent testing and validation activities.

Identifying Custom Security Logic

Custom modules often contain hardcoded security logic that may break during an upgrade. For example, a module might directly query the database to check user permissions, bypassing Odoo's standard security framework. Such implementations are fragile and prone to failure when the underlying data structure changes. The assessment team must review the source code of all custom modules to identify any direct database access, modified security methods, or custom record rules. This code review is critical because it highlights areas where manual intervention is required. Modules that rely on deprecated APIs or removed fields will need to be rewritten. The goal is to create a list of security-related customizations that require specific attention during the migration. This list should be prioritized based on the criticality of the business processes they support. High-risk modules, such as those handling financial data or customer information, should be addressed first to minimize exposure.

Mapping Access Rights to the Target Version

Once the current state is documented, the next step is to map these access rights to the target Odoo version. Security models can evolve between versions, with changes to default group permissions, new security features, or modifications to how multi-company data is handled. It is essential to verify the compatibility of existing security configurations against the official documentation for the specific source and target versions. Do not assume that permissions will carry over automatically. For instance, a group that had read access to a specific model in the source version might require explicit configuration in the target version. The mapping process involves creating a matrix that compares source and target permissions for each user group and role. This matrix should highlight any discrepancies, such as permissions that are no longer available or new permissions that need to be assigned. This step is particularly important for multi-company setups, where the interaction between company-specific rules and global rules can be complex. The mapping should also consider the impact of any new security features introduced in the target version, such as enhanced audit logging or two-factor authentication options. By proactively addressing these changes, the project team can prevent security gaps that might otherwise go unnoticed until after go-live.

Handling Multi-Company Data Isolation

Multi-company data isolation is a critical aspect of Odoo security. In a multi-company environment, users should only see data from their assigned company unless explicitly granted cross-company access. During migration, it is crucial to ensure that this isolation is maintained. This involves verifying that all record rules correctly filter data based on the company ID. If a record rule is missing or misconfigured, users from one company might inadvertently see data from another, leading to data leakage and compliance violations. The mapping process should include a specific check for all record rules that involve company filtering. Additionally, the team should review any custom modules that modify company-related fields or logic. These modules must be tested to ensure they respect the multi-company architecture. For example, a module that allows users to view reports across multiple companies should have strict permission checks to prevent unauthorized access. By focusing on data isolation, the project team can protect the integrity of business data and maintain trust among stakeholders.

Technical Execution: Database and Code Migration

The technical execution phase involves migrating the database and code to the target environment. This is where the security configurations are physically transferred. The database migration must preserve all security-related data, including user accounts, groups, permissions, and record rules. It is essential to perform a full backup of the source database before starting the migration. This backup serves as a rollback point in case of failure. During the migration, the team should use official Odoo upgrade tools or scripts to ensure that the database schema is updated correctly. Custom modules must be installed in the target environment, and their security configurations must be verified. If any custom modules fail to install or exhibit unexpected behavior, they should be isolated and addressed immediately. The code migration should include a review of all security-related code changes. This includes updating any deprecated API calls, modifying record rules to match the new schema, and ensuring that custom security methods are compatible with the target version. The goal is to create a target environment that is functionally identical to the source environment in terms of security, but updated to the new version. This environment will be used for extensive testing before the final cutover.

Managing API and Integration Security

API integrations are a common source of security vulnerabilities during migrations. Service accounts and tokens used for API access must be updated to reflect any changes in authentication mechanisms or permission models. The team should review all API endpoints to ensure that they are secured with appropriate authentication and authorization checks. This includes verifying that API keys are rotated and that access is restricted to necessary endpoints. Additionally, the team should test API integrations in the staging environment to ensure that they function correctly with the new security configurations. Any issues with API access should be resolved before the final cutover. This step is critical because API failures can disrupt business processes and lead to data inconsistencies. By proactively managing API security, the project team can ensure that integrations remain secure and reliable after the migration.

Validation and Testing Strategies

Validation is the most critical phase of the migration, as it ensures that the security configurations work as intended. The testing strategy should include unit tests, integration tests, and end-to-end business process tests. Unit tests should verify that individual security rules and permissions function correctly. Integration tests should check that security configurations work across different modules and integrations. End-to-end tests should simulate real-world business scenarios, such as a user from Company A attempting to access data from Company B. These tests should be performed in a representative staging environment that mirrors the production environment in terms of data volume and complexity. The testing team should use a checklist to ensure that all security aspects are covered, including user login, permission checks, record visibility, and API access. Any defects found during testing should be documented and triaged based on severity. High-severity defects, such as data leakage or unauthorized access, must be resolved before the migration can proceed. This rigorous testing process helps identify and fix security issues before they impact the production environment.

User Acceptance Testing for Security

User Acceptance Testing (UAT) is an essential part of the validation process. UAT involves having key users from different departments and companies test the system to ensure that their access rights are correct. This step is crucial because it validates the security configurations from the user's perspective. Users should be provided with a list of test cases that cover their specific roles and responsibilities. For example, a finance manager should test their ability to view financial reports for their company and verify that they cannot access reports from other companies. UAT helps identify any gaps in the security configuration that may have been missed during automated testing. It also provides an opportunity for users to provide feedback on the user experience and any potential usability issues related to security. By involving users in the testing process, the project team can ensure that the security configurations meet the needs of the business and that users are comfortable with the new system.

Deployment and Cutover Planning

The deployment phase involves moving the validated system to the production environment. This is a high-risk activity that requires careful planning and coordination. The cutover plan should include a detailed runbook that outlines all steps, responsible parties, and timelines. The plan should also include go/no-go criteria, which are specific conditions that must be met before the migration can proceed. These criteria should include the successful completion of all testing, the resolution of all high-severity defects, and the approval of key stakeholders. The cutover should be performed during a scheduled maintenance window to minimize downtime. Before the cutover, a final backup of the production database should be taken. This backup serves as a rollback point in case of failure. During the cutover, the team should monitor the system closely for any security-related issues. Any anomalies should be investigated immediately. The cutover plan should also include a communication plan to inform users of the migration and any potential disruptions. By following a well-defined cutover plan, the project team can minimize the risk of security incidents and ensure a smooth transition to the new system.

Rollback and Recovery Strategies

A robust rollback strategy is essential for mitigating the risks associated with ERP migrations. The rollback plan should define the conditions under which the migration will be rolled back, such as critical security failures or data corruption. The plan should also outline the steps required to restore the system to its pre-migration state. This includes restoring the database from the final backup, reverting any code changes, and reconfiguring any integrations. The rollback process should be tested in the staging environment to ensure that it works as expected. By having a well-defined rollback strategy, the project team can quickly recover from any issues and minimize the impact on the business. This strategy also provides peace of mind to stakeholders, knowing that there is a plan in place to handle any unexpected problems.

Post-Migration Stabilization and Monitoring

After the migration is complete, the system enters the stabilization phase. This phase involves monitoring the system for any security-related issues and making any necessary adjustments. The IT team should closely monitor system logs for any unauthorized access attempts or permission errors. They should also review audit logs to ensure that all user actions are recorded correctly. Any issues found during this phase should be addressed promptly. The stabilization phase also involves providing support to users who may have questions or concerns about the new system. This support is crucial for ensuring user adoption and minimizing disruption to business processes. By actively monitoring and supporting the system during the stabilization phase, the project team can ensure that the migration is successful and that the system remains secure and reliable.

Continuous Security Auditing

Security is an ongoing process, not a one-time event. After the migration, the organization should implement a continuous security auditing process to ensure that the system remains secure over time. This includes regular reviews of user permissions, access rights, and security configurations. The organization should also stay up-to-date with the latest security best practices and Odoo security updates. By continuously auditing the system, the organization can identify and address any security vulnerabilities before they are exploited. This proactive approach helps protect the business data and maintain compliance with internal and external regulations.

Risk Mitigation and Compliance

Mitigating risks and ensuring compliance are critical aspects of a multi-company Odoo migration. The project team should identify all potential risks and develop strategies to mitigate them. This includes risks related to data leakage, unauthorized access, and system downtime. The team should also ensure that the migration complies with all relevant regulations and standards, such as GDPR, HIPAA, or industry-specific requirements. This involves implementing appropriate security controls, such as encryption, access controls, and audit logging. By proactively addressing risks and ensuring compliance, the project team can protect the business and maintain trust among stakeholders. This approach also helps reduce the likelihood of security incidents and regulatory penalties.

Conclusion: Prioritizing Security in ERP Migrations

In conclusion, security and access control are paramount in multi-company Odoo migrations. By following a structured approach that includes assessment, mapping, technical execution, validation, deployment, and stabilization, organizations can mitigate risks and ensure a secure migration. Key takeaways include the importance of auditing existing security configurations, mapping access rights to the target version, testing thoroughly in a representative environment, and having a robust rollback strategy. By prioritizing security, CIOs and IT directors can protect business data, maintain operational continuity, and ensure long-term ERP maintainability. This approach not only reduces the risk of security incidents but also enhances the overall value of the ERP system.

Written by
SysGenPro Editorial

SysGenPro Editorial

Platform & solutions team

Practical guidance on ERP, AI automation, cloud deployment and enterprise transformation from the SysGenPro team.

Share this article

Frequently asked questions

Common questions on this topic. Talk to our team for anything specific to your business.

01How does Odoo handle data isolation between companies?

Odoo uses record rules to filter data based on the company ID. Users can only see data from their assigned company unless explicitly granted cross-company access through specific permissions.

02What are the main security risks in Odoo upgrades?

Main risks include broken custom security modules, deprecated API endpoints, misconfigured cross-company access rights, and unintended data leakage due to changes in security models.

03How should access rights be tested after migration?

Access rights should be tested using unit tests, integration tests, and end-to-end business process tests in a representative staging environment. User Acceptance Testing (UAT) is also essential to validate permissions from the user's perspective.

04Can custom security modules be migrated automatically?

Custom security modules cannot always be migrated automatically. They often require manual review and refactoring to ensure compatibility with the target version's security framework and APIs.

05What is the role of record rules in multi-company setups?

Record rules define which specific records within a model are visible to a user based on criteria such as company ID. They are crucial for enforcing data isolation in multi-company environments.

06How to audit user permissions before Odoo migration?

Audit user permissions by inventorying all user groups, roles, and individual permissions. Review custom modules for hardcoded security logic and verify API access rights. Create a baseline documentation for reference.

Continue learning
View all articles
Explore the platform

Where to go next

Browse the knowledge hub

See how SysGenPro fits your business

Discuss your workflows, modules and deployment options with our team.

Back to resources