Deploy Odoo module repo¶
This guide walks you through deploying the OCA partner-contact modules on an Odoo server. The modules are pulled from a git repo into the addons directory of the Odoo deployment.
The example assumes an Odoo 19.0 deployment with the hostname odoo01, which results in the addons path /usr/share/odoo01/addons.
Requirements¶
The odoo_repos scripts must be installed on the server. They allow users in the odoo_group to manage the module repos.
Check that the scripts are available.
Add the repo¶
Clone the partner-contact repo on branch 19.0 into the addons directory.
odoo-repos-clone \
-p /usr/share/odoo01/addons \
-r https://github.com/OCA/partner-contact.git \
-b 19.0 \
-t oca-partner-contact
The parameters are:
-pthe addons path.-rthe git repo url.-bthe git branch, use the branch matching the Odoo version.-tthe target path relative to the addons path.
The repo is cloned to /usr/share/odoo01/addons/oca-partner-contact.
Clone a private repo¶
For a private repo, pass the ssh url with -r and the deploy key with -k.
odoo-repos-clone \
-p /usr/share/odoo01/addons \
-r ssh://git@github.com/Mint-System/Odoo-Apps-Customer-Repo.git \
-b 19.0 \
-t mint-system-customer-repo \
-k ~/.ssh/odoo-apps-customer-repo
-r accepts ssh://, https:// and the scp-like git@host:path form. The key is detected for both ssh variants, https:// ignores -k.
-k persists the key in the repo config, so later pulls work without the parameter.
See the ssh role for generating and deploying the deploy key.
Verify the repo¶
List the repos in the addons directory.
The output is a YAML list that can be copied into the odoo_repos var of the role.
odoo_repos:
- path: oca-partner-contact
url: https://github.com/OCA/partner-contact.git
branch: 19.0
A private repo records the ssh url instead.
odoo_repos:
- path: mint-system-customer-repo
url: ssh://git@github.com/Mint-System/Odoo-Apps-Customer-Repo.git
branch: 19.0
Update the repo¶
Pull the latest changes of all repos in the addons directory.
Or pull a single repo.
Install the modules¶
Restart the Odoo container to load the new addons path.
Then install a module from the repo, for example partner_firstname.
Manage the repo with Ansible¶
To keep the repo in sync with the deployment, add it to the odoo_repos var of the odoo_repos role.