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 serverodood restart- restart odoo serverodood stop- stop odoo serverodood log- see odoo server logsodood browse- open running odoo installation in browserodood 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 directoryodood addons where <name>- show where an addon is located (Odoo core / custom repo / download), and whether it is linked and installableodood addons update-list- update list of available addons in all databases available for this serverodood addons install <addon1> [addonN]- install specified odoo addons for all databases available for this server; use--missing-onlyto skip already-installed onesodood addons update <addon1> [addonN]- update specified odoo addons for all databases available for this server; use--installed-onlyto skip non-installed onesodood addons uninstall <addon1> [addonN]- uninstall specified odoo addons for all databases available for this serverodood addons update --dir <path>- find all installable addons in specified directory and update themodood addons install --dir <path>- find all installable addons in specified directory and install themodood 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 databaseodood test -t --dir .- test all installable addons in current directoryodood test -t --migration --dir .- run migration tests for all installable addons in current directoryodood test --coverage-html -t <module>- test single module and create html coverage reportodood 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 countodood repo add <url>- fetch repository with third-party addons from git repo specified byurl. Local repositories are supported viafile://URLs with absolute paths (for examplefile:///data/repos/my-addons) - useful for local mirrors or pre-fetched repositories in CI.odood repo add --oca <name>- fetch OCA repository namednamefrom OCA git repo. For example,--oca webmeans 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/webmeans 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- generateCHANGELOG.md, commit it, tag, and push branch + tag to origin.odood repo release --addons-list-md --addons-list-csv- additionally generateADDONS.md/ADDONS.csvlisting 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 instanceodood db create my_db- create databaseodood db backup my_db- backup my_dbodood db backup -a- backup all databases on the serverodood db drop my_db- drop databaseodood 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 addonsodood 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 instanceodood assembly init --repo=git@github.com:my/assembly.git- initialize this instance with assembly from specified repoodood assembly upgrade- pull latest changes from assembly and upgrade serverodood assembly sync- synchronize assembly according to spec: fetch latest versions of modules from specified sources and update assembly repoodood assembly upgrade-sources- advance version-tag-pinned sources in the spec to the newest matching tags on their remotes; follow up withassembly syncto applyodood assembly release --changelog --push- assign the next assembly version, generate the changelog, commit, tag and pushodood 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-1when 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-1when a changed addon has no version bump.odood repo ensure-changelog-1when a required changelog entry is missing.odood repo release,odood repo hotfix release,odood assembly release-0when there is nothing to release;1with--fail-nothing-to-release.odood assembly syncwith--commitor--push-0when there is nothing to commit;1with--fail-nothing-to-commit.