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.
Prepare the addons directory¶
Ensure the addons directory exists and is owned by the Odoo owner and group. The user running the scripts must be a member of the Odoo group.
sudo mkdir -p /usr/share/odoo01/addons
sudo chown root:odoo /usr/share/odoo01/addons
sudo usermod -aG odoo "$USER"
Note
The odoo-repos-clone script applies the group of the addons path to the cloned repo. Set the group before cloning.
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.
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
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.
odoo_repos:
- path: oca-partner-contact
url: https://github.com/OCA/partner-contact.git
branch: 19.0
Warning
The role removes directories in the addons path that are not listed in odoo_repos. Add all manually cloned repos to the var before running the role.