Introducing odoo-addons-path: a developer-friendly tool to manage Odoo Addon Paths

Trong OCA

Managing the addons_path configuration in Odoo projects looks simple until you maintain multiple repos, submodules and so on. Different project layouts organize addons in their own unique structures and the order in which these directories appear is critical. A misplaced folder can silently override or load the wrong custom module.


odoo-addons-path removes that burden. It is a tool that automatically detects your project layout and assembles the final addons_path, ensuring the proper order and eliminating manual configuration errors.

What is it?

odoo-addons-path is a CLI tool that solely:

  • Auto-detects common Odoo project layouts (Camptocamp, Doodba, Odoo.sh, Trobz).

  • Builds a correct, ordered and read-to-use addons_path.

  • Applies consistent detection logic through the Chain of Responsibility pattern (read more about it here)

It focuses on one thing and does it well: producing a reliable and predictable addons_path for any Odoo codebase.

Why built it?

There is no single standard layout for Odoo projects. Different teams adopt different structures, resulting in variations such as:

  1. Trobz
    ├── odoo/               # Odoo core
    ├── addons/           # Third-party repos
    └── project/            # Custom modules

  2. Doodba
    odoo/custom/src/
    ├── odoo/                # Odoo core
    ├── private/             # Custom modules
    └── submodule/    # Third-party repos

  3. odoo.sh
    ├── odoo/                # Odoo core
    ├── enterprise/
    ├── themes/
    └── user/               # Submodules

Because each layout must be interpreted differently, manually constructing it becomes tedious and error-prone. odoo-addons-path was created to standardize the process across common layouts.

How to use it?

1. Quick Start

    Inside your Odoo project directory:

    $ odoo-addons-path

    The tool outputs a ready-to-use addons_path.
    If the project follows one of out-of-box structure patterns, detection works immediately!

    Out-of-the-box Detection supports:

  • Camptocamp (both legacy and new layouts)

  • Doodba (Docker-based development)

  • Odoo.sh (Odoo's official hosting platform)

  • Trobz

Enable verbose mode --verbose to inspect how directories are categorized.

2. Advanced usage with custom path

You can override detection using –addons-dir, which supports multiple entries and glob patterns:

Version-specific addon discovery

$ odoo-addons-path --addons-dir "./oca/*/18.0"


Multiple repository directories

$ odoo-addons-path --addons-dir "./oca/*/18.0"

You can also set the codebase path via environment variable:

$ export CODEBASE=/path/to/project \
  odoo-addons-path

Up to this point, you might have asked: Does the Order of directories in param addons_path matter?

Absolutely, the tool ensures:

  • Odoo native modules come first in order to avoid wrongfully overridden. Hence odoo/addons and odoo/odoo/addons are always at the beginning of the result.

  • User-specified directories maintain their order. In other words, when you use --addons-dir, those paths preserve the order you specify, allowing you to prioritize repositories. This is extremely important, especially when we need to prioritize a specific addons_dir in some projects. 

  • Auto-detected directories are sorted alphabetically. When the tool auto-detects directories, it sorts them to ensure consistent and predictable behavior.

Conclusion

odoo-addons-path eliminates the manual work and hidden pitfalls of constructing Odoo’s addons_path. Whether you’re working with standard project layouts or custom structures, the tool automatically detects and orders your addon directories correctly, ensuring Odoo core modules are always prioritized and allowing for repository-level customization when needed.

Give it a try:

$ uv pip install odoo-addons-path \
odoo-addons-path /path/to/your/project