The implementation of a modern ERP goes beyond installing standard modules related to business operations; it requires orchestrating a complex and customized digital ecosystem. When scaling operations with Odoo, consulting teams constantly face the challenge of managing the source code securely and efficiently. In this context, adding third-party integrations, new developments, and tax adaptations to the main project repository can turn it into a monolith prone to integration conflicts and difficult to debug in production.
It is worth noting that modern software engineering solves this by decentralizing the code. Integrating new functionalities in Odoo as submodules in Odoo.sh allows for maintaining a distributed and clean architecture, where custom modules, API integrations, and complex business logic reside in independent Git repositories. These pieces are dynamically attached, ensuring secure deployments, frictionless continuous integration, and truly scalable version control aligned with the Management of External Developments in Odoo ERP.
Configuration and Deployment of Dependencies in the Cloud
Although it may seem intrinsic, for the CI/CD channels on the Odoo.sh platform to compile correctly, the submodules must be associated in the allowed path within the internal directories of Odoo's logic. In this sense, the corresponding location is the directory custom_addons for the Management of External Developments in Odoo ERP. To initialize the external repository in the main project, the following git command is executed in the command line:
git submodule add <remote-repository-URL> <local-destination-path>
It is important to understand that Odoo.sh uses deployment keys (Deploy Keys) or access tokens from the GitHub application to clone these repositories into its containers. Therefore, the management of external code in Odoo ERP is done through the .gitmodules file: when executing the previous command, Git generates or updates a hidden file called .gitmodules at the root of the project. This file
indicates to the platform the remote URL of the corresponding repository and the virtual local subdirectory where the application or module that is incorporated into the functional structure of the ERP is hosted. To facilitate the understanding of this description, the structure of the .gitmodules file for each submodule attached to the main repository of the implementation is presented below.
[submodule "custom_addons/purchase_portal_invoice"]
path = custom_addons/purchase_portal_invoice
url = git@github.com:businessinsights-mx/purchase_portal_invoice.git
It is relevant to understand that, after registering a commit and pushing, the platform will initialize the submodule recursively. It is noteworthy that the DevOps administrator of the Odoo.sh platform must certify in the web settings (Settings) of the project that the subdirectory of the submodule is explicitly included in the --addons-path variable. Without this validation, Odoo will not recognize the linked code in its application catalog.
Maintenance Strategies and Functional Testing
Unlike a conventional directory, a submodule in Git functions as a static pointer to a specific commit, generally associated with the main branch of the development or application repository; by definition, a change or update is not automatically tracked. Therefore, if improvements are made in the external repository, these will not automatically reflect in the management of external code in Odoo ERP. To update, the administrator must navigate to the submodule directory locally and execute a git fetch followed by a git pull from the production branch. Next, it is mandatory to make a new commit in the base repository certifying the update of the pointer and finish with a push to the server. Odoo.sh will download the new reference and execute database migrations if it detects version increments in the __manifest__.py files.
Log Management and Common Errors
Despite its advantages, orchestrating nested repositories for the management of submodules in Odoo ERP can generate technical error scenarios that require quick diagnostics. In this context, some of the common scenarios correspond to the following:
· Detached HEAD: It occurs if a developer modifies submodule files for an adjustment without first executing a git checkout to a valid branch. The commits will remain virtual/orphaned, risking loss of work. This is prevented by always checking the branch status before altering internal code.
· Silent failure: The build logs report success, but the applications do not appear in the ERP. This often happens due to expired GitHub access tokens or by omitting the directory in the addons path. To resolve this, the administrator responsible for External Development Management in Odoo ERP inspects the build logs, confirms the correct path, and in Odoo, activates developer mode to force the update of the "Applications List" compelling the system to re-scan the directory.
· Unit test warning: These are informational messages indicating that the code executed, but something was detected that is not optimal, is outdated, or could cause problems in the future. It constitutes an important element of attention because, unlike an ERROR or a FAIL, a Warning does not break the container build or stop continuous integration by itself, but Odoo.sh monitors them closely due to the strict platform stability policy. In these scenarios, the administrator must review the logs generated by the build and detect threats that could affect the platform's stability.
In summary, adopting versioning strategies based on submodules for the management of submodules in Odoo ERP ensures the separation of responsibilities, promotes the reuse of modules developed with code, and maintains the integrity of the platform.
Are you facing the need to deploy advanced integrations in your Odoo ERP? It's time to audit and reorganize the version control structure of your implementation on the Odoo.sh platform. Contact us to help you consolidate a decentralized architecture in your staging environment to enhance the efficiency of your CI/CD channels and make the most of your Odoo ERP. If you need personalized advice tailored to your business reality, get in touch with our commercial support team and learn about our consulting services.