Skip to content

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.

curl -L https://ansible.build/odoo_repos/install | sudo bash

Check that the scripts are available.

odoo-repos-list help

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:

  • -p the addons path.
  • -r the git repo url.
  • -b the git branch, use the branch matching the Odoo version.
  • -t the 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.

odoo-repos-pull -p /usr/share/odoo01/addons/mint-system-customer-repo

See the ssh role for generating and deploying the deploy key.

Verify the repo

List the repos in the addons directory.

odoo-repos-list -p /usr/share/odoo01/addons

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.

odoo-repos-pull -p /usr/share/odoo01/addons

Or pull a single repo.

odoo-repos-pull -p /usr/share/odoo01/addons/oca-partner-contact

Install the modules

Restart the Odoo container to load the new addons path.

docker restart odoo01

Then install a module from the repo, for example partner_firstname.

docker-odoo-init -c odoo01 -d odoo -i 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