# Introducing odoo-addons-path: A Developer-Friendly Tool to Manage Odoo Addon Paths

> odoo-addons-path detects common Odoo project layouts and builds a correctly ordered addons_path, so developers no longer assemble it by hand.

**Source:** <https://trobz.com/insights/introducing-odoo-addons-path/>

---


Managing the [`addons_path`](https://www.odoo.com/documentation/19.0/developer/reference/cli.html#cmdoption-odoo-bin-addons-path) setting in Odoo projects looks simple until you maintain several repositories, submodules and more. Each project layout organizes addons in its own way, and the order of the directories matters: a misplaced folder can silently override a module or load the wrong custom module.

[odoo-addons-path](https://github.com/trobz/odoo-addons-path) removes that burden. It detects your project layout and assembles the final `addons_path` in the right order, so developers no longer configure it by hand and risk mistakes.

## What Is It?

odoo-addons-path is a command-line tool that does one job:

- Auto-detects common Odoo project layouts: Camptocamp, Doodba, Odoo.sh and Trobz
- Builds a correct, ordered, ready-to-use `addons_path`
- Applies the same detection logic to every layout through the Chain of Responsibility pattern ([read more about the pattern]({{< surl >}}/insights/design-patterns-odoo-chain-of-responsibility/))

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

## Why We Built It

There is no single standard layout for Odoo projects. Teams adopt different structures, for example:

**Trobz**

```text
├── odoo/        # Odoo core
├── addons/      # Third-party repos
└── project/     # Custom modules
```

**Doodba**

```text
odoo/custom/src/
├── odoo/        # Odoo core
├── private/     # Custom modules
└── submodule/   # Third-party repos
```

**Odoo.sh**

```text
├── odoo/        # Odoo core
├── enterprise/
├── themes/
└── user/        # Submodules
```

Because each layout has to be read differently, building the `addons_path` by hand is tedious and error-prone. odoo-addons-path was created to standardize the process across common layouts.

## How to Use It

### Quick Start

Inside your Odoo project directory, run:

```bash
odoo-addons-path
```

The tool outputs a ready-to-use `addons_path`. If the project follows one of the supported layouts, detection works immediately. Supported out of the box:

- Camptocamp (both legacy and new layouts)
- Doodba (Docker-based development)
- Odoo.sh (Odoo's official hosting platform)
- Trobz

Add `--verbose` to see how directories are categorized.

### Custom Paths

You can override detection with `--addons-dir`, which accepts multiple entries and glob patterns.

Version-specific addon discovery:

```bash
odoo-addons-path --addons-dir "./oca/*/18.0"
```

Multiple repository directories:

```bash
odoo-addons-path --addons-dir "./oca/*/18.0,./custom"
```

You can also set the codebase path with an environment variable:

```bash
export CODEBASE=/path/to/project
odoo-addons-path
```

### Does the Order of Directories Matter?

Yes. The tool ensures that:

- **Odoo's own modules come first**, so they are not overridden by mistake. `odoo/addons` and `odoo/odoo/addons` are always at the start of the result.
- **Directories you specify keep their order.** Paths passed with `--addons-dir` stay in the order you give, so you can prioritize repositories. This is especially important when a project needs a specific addons directory to take priority.
- **Auto-detected directories are sorted alphabetically**, which keeps the behavior consistent and predictable.

## Conclusion

odoo-addons-path removes the manual work, and the hidden pitfalls, of building Odoo's `addons_path`. Whether you work with a standard project layout or a custom structure, the tool detects your addon directories and orders them correctly: Odoo core modules always come first, and you can still prioritize repositories when needed.

Give it a try:

```bash
uv tool install odoo-addons-path
odoo-addons-path /path/to/your/project
```

