Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Frequently used commands

Short list of frequently used Odood commands. Each command in this list supports -h or --help option, that will print actual documentation on the command. Thus, if you want to get most complete and actual documentation on particular command, just call if with -h option.

Commands act on the project found from the current directory. To target another one, pass -c <path to odood.yml or its directory> before the command name — see Working with Multiple Instances.

Server management

  • odood start - start odoo server
  • odood restart - restart odoo server
  • odood stop - stop odoo server
  • odood log - see odoo server logs
  • odood browse - open running odoo installation in browser
  • odood server healthcheck - check if the Odoo HTTP server is responding; exits 0 if healthy, 1 if not. Useful as a Docker/K8s health probe.
  • odood server wait-pg - wait for PostgreSQL to become available before proceeding. Useful in container entrypoints when the DB container may not be ready yet.

Addons management

  • odood addons list <path> - list odoo addons in specified directory
  • odood addons where <name> - show where an addon is located (Odoo core / custom repo / download), and whether it is linked and installable
  • odood addons update-list - update list of available addons in all databases available for this server
  • odood addons install <addon1> [addonN] - install specified odoo addons for all databases available for this server; use --missing-only to skip already-installed ones
  • odood addons update <addon1> [addonN] - update specified odoo addons for all databases available for this server; use --installed-only to skip non-installed ones
  • odood addons uninstall <addon1> [addonN] - uninstall specified odoo addons for all databases available for this server
  • odood addons update --dir <path> - find all installable addons in specified directory and update them
  • odood addons install --dir <path> - find all installable addons in specified directory and install them
  • odood addons link . - link all addons in current directory.
  • odood addons add -h - add third-party addons from odoo-apps (free only) or from odoo-requirements.txt

Both install and update support --ignore-unfinished-updates to proceed even if the database has pending addon state transitions.

Tests

  • odood test -t <module> - test single module on temporary database
  • odood test -t --dir . - test all installable addons in current directory
  • odood test -t --migration --dir . - run migration tests for all installable addons in current directory
  • odood test --coverage-html -t <module> - test single module and create html coverage report
  • odood test --coverage-html --dir . - test all installable addons and create html coverage report

Pre-commit

Odood use pre-commit to run various linters, etc. Thus following commands are used to deal with it:

  • odood pre-commit init - Initialize pre-commit for repository. Create default pre-commit configurations.
  • odood pre-commit set-up - Install pre-commit and all necessary dependencies in virtualenv.
  • odood pre-commit run - Run pre-commit hooks for this repo manually.
  • odood pre-commit update - Update the hook versions in the repo’s pre-commit config (pre-commit autoupdate).

Repository management

  • odood repo list - list git repositories of this project with branch and addon count
  • odood repo add <url> - fetch repository with third-party addons from git repo specified by url. Local repositories are supported via file:// URLs with absolute paths (for example file:///data/repos/my-addons) - useful for local mirrors or pre-fetched repositories in CI.
  • odood repo add --oca <name> - fetch OCA repository named name from OCA git repo. For example, --oca web means repo web from OCA.
  • odood repo add --github <username/repository> - shortcut to easily fetch repo from github, by specifying only github username and repo name. For example: --github oca/web means repo web from OCA.
  • odood repo pull-all - fast-forward all repositories to their upstreams and relink addons of the updated ones; ends with a summary of the repositories it did not pull.
  • odood repo bump-versions - increase versions of changed modules in git repo.
  • odood repo check-versions - check that changed addons have their versions bumped.
  • odood repo ensure-changelog - check that changed addons carry a changelog entry.
  • odood repo release --initial - create the first release tag (<serie>.1.0.0) for a repository with no prior tags.
  • odood repo release - auto-detect changed addons since the last tag, verify versions are bumped, and create the next release tag.
  • odood repo release --changelog --push - generate CHANGELOG.md, commit it, tag, and push branch + tag to origin.
  • odood repo release --addons-list-md --addons-list-csv - additionally generate ADDONS.md / ADDONS.csv listing the repository’s addons.
  • odood repo hotfix start|check|release - patch releases on a dedicated hotfix branch: set it up from a release tag, check versions against its patch chain, release. See Hotfix Flow.

Scripts

  • odood script list - list scripts that can be run by name.
  • odood script py -d my_db <script> - run a Python script with the Odoo environment of my_db.
  • odood script sql -d my_db <script> - run an SQL script on my_db.

See Custom Scripts for where scripts are looked up.

Database management

  • odood db list - list all databases available for current odoo instance
  • odood db create my_db - create database
  • odood db backup my_db - backup my_db
  • odood db backup -a - backup all databases on the server
  • odood db drop my_db - drop database
  • odood db restore my_db path/to/backup - restore database from backup

Translation management

  • odood tr regenerate --lang uk_UA <addon1> [addon2]... - regenerate translations for specified language for specified addons
  • odood tr regenerate --lang uk_UA --addon-dir <path> - regenerate translations for specified language for all installable addon in specified path

Assembly management

  • odood assembly init - initialize new empty assembly for this instance
  • odood assembly init --repo=git@github.com:my/assembly.git - initialize this instance with assembly from specified repo
  • odood assembly upgrade - pull latest changes from assembly and upgrade server
  • odood assembly sync - synchronize assembly according to spec: fetch latest versions of modules from specified sources and update assembly repo
  • odood assembly upgrade-sources - advance version-tag-pinned sources in the spec to the newest matching tags on their remotes; follow up with assembly sync to apply
  • odood assembly release --changelog --push - assign the next assembly version, generate the changelog, commit, tag and push
  • odood assembly link - relink all addons that are in assembly

Virtualenv management

  • odood venv run -- <command and args> - Run some command inside virtualenv of this instance.
  • odood venv install-py-packages - Install specified python packages in this virtualenv.
  • odood venv install-dev-tools - Install development tools inside virtualenv of this instance.
  • odood venv ipython - run ipython inside virtualenv of this instance.
  • odood venv reinstall - reinstall virtual environment.
  • odood venv update-odoo - update Odoo in this instance.

Exit codes for automation

Scripts and CI can rely on these exit codes:

  • odood repo pull-all - 1 when a repository could not be fetched, has diverged from its upstream, or its addons could not be linked. Skipped repositories (uncommitted changes, detached HEAD, no upstream, upstream deleted on the remote) do not count.
  • odood repo check-versions, odood repo hotfix check - 1 when a changed addon has no version bump.
  • odood repo ensure-changelog - 1 when a required changelog entry is missing.
  • odood repo release, odood repo hotfix release, odood assembly release - 0 when there is nothing to release; 1 with --fail-nothing-to-release.
  • odood assembly sync with --commit or --push - 0 when there is nothing to commit; 1 with --fail-nothing-to-commit.