Skip to content

Odoo Sources

Commands for managing local Odoo Community and Enterprise source checkouts.

All three commands share a common base directory that holds one subdirectory per Odoo version:

<sources_dir>/
├── 17.0/
│   ├── community/     ← git@github.com:odoo/odoo.git
│   └── enterprise/    ← git@github.com:odoo/enterprise.git
└── 19.0/
    └── community/

The base directory is configured once in ~/.oops.yaml and shared across the team:

odoo:
  sources_dir: ~/odoo-sources

All commands accept --base-dir to override the config value ad hoc.


Configuration

Key Default Description
odoo.sources_dir (required) Root directory that holds version subdirectories
odoo.community_url git@github.com:odoo/odoo.git Community repository URL
odoo.enterprise_url git@github.com:odoo/enterprise.git Enterprise repository URL

Both URL fields can be overridden to point at a fork or a mirror.


oops-odoo-download

Download (or update) Odoo Community and Enterprise source code.

Clones Community and Enterprise (when --enterprise is passed) from GitHub using SSH into:

<base_dir>/<version>/community
<base_dir>/<version>/enterprise

The base directory is read from odoo.sources_dir in ~/.oops.yaml (or .oops.yaml) and can be overridden with --base-dir.

If a directory already exists the clone step is skipped. Pass --update to pull the latest changes instead.

Usage:

oops-odoo-download [OPTIONS] VERSION

Options:

Name Type Description Default
--base-dir directory Root directory for Odoo sources. Defaults to odoo.sources_dir in config. None
--update boolean Pull latest changes if repos already exist. False
--enterprise / --no-enterprise boolean Include or exclude Enterprise in the update. True
--help boolean Show this message and exit. False

Examples:

Clone Community and Enterprise for Odoo 19 (Enterprise is included by default):

oops-odoo-download 19.0

The short form 19 is also accepted and normalised to 19.0:

oops-odoo-download 19

Clone Community only, skipping Enterprise:

oops-odoo-download 19.0 --no-enterprise

Update existing checkouts to the latest commit:

oops-odoo-download 19.0 --update
oops-odoo-download 19.0 --update --no-enterprise

Use a custom base directory (overrides config):

oops-odoo-download 19.0 --base-dir /tmp/odoo-src

oops-odoo-update

Update Odoo Community and Enterprise source checkouts.

Operates on repositories previously cloned by oops-odoo-download into:

<base_dir>/<version>/community
<base_dir>/<version>/enterprise

The base directory is read from odoo.sources_dir in ~/.oops.yaml (or .oops.yaml) and can be overridden with --base-dir.

Without --date, fetches and checks out the latest commit on the branch.

With --date YYYY-MM-DD, fetches history back to that date and checks out the last commit that existed at or before midnight of that day, leaving the working tree in a detached-HEAD state at the chosen snapshot.

Pass --enterprise to also update the Enterprise checkout.

Usage:

oops-odoo-update [OPTIONS] VERSION

Options:

Name Type Description Default
--base-dir directory Root directory for Odoo sources. Defaults to odoo.sources_dir in config. None
--date datetime (%Y-%m-%d) Checkout the last commit at or before this date. None
--enterprise / --no-enterprise boolean Include or exclude Enterprise in the update. True
--help boolean Show this message and exit. False

Examples:

Pull the latest commit on the branch (Enterprise included by default):

oops-odoo-update 19.0

Update Community only, skipping Enterprise:

oops-odoo-update 19.0 --no-enterprise

Checkout the state of the codebase as of a given date (detached HEAD):

oops-odoo-update 19.0 --date 2024-06-01
oops-odoo-update 19.0 --date 2024-06-01 --no-enterprise

Note

--date uses a shallow fetch (git fetch --shallow-since). The first call for a given date may take a moment to download history.


oops-odoo-show

List locally available Odoo source checkouts.

Scans the sources directory for version folders and shows, for each version, the current commit hash and author date for Community and Enterprise.

The sources directory is read from odoo.sources_dir in ~/.oops.yaml and can be overridden with --base-dir.

Usage:

oops-odoo-show [OPTIONS]

Options:

Name Type Description Default
--base-dir directory Root directory for Odoo sources. Defaults to odoo.sources_dir in config. None
--help boolean Show this message and exit. False

Examples:

List all locally available Odoo source checkouts:

oops-odoo-show

Example output:

| Version | Community                             | Enterprise                            |
|---------|---------------------------------------|---------------------------------------|
| 17.0    | a1b2c3d4  2024-11-15 10:22:31 +0100  | e5f6g7h8  2024-11-14 18:03:12 +0100  |
| 19.0    | 9i0j1k2l  2025-01-08 09:11:44 +0100  | —                                     |

A in the Enterprise column means the Enterprise checkout is not present (run oops-odoo-download <version> --enterprise to add it).