Odoo databases management CLI tool
Project description
odoo-db
CLI tool for Odoo database management. Connects to local PostgreSQL via Unix socket (peer auth — no credentials needed). Designed for developers running Odoo locally.
Installation
uv tool install git+https://github.com/trobz/odoo-db
Or for development:
git clone https://github.com/trobz/odoo-db
cd odoo-db
make install # install deps + pre-commit hooks
uv tool install --editable . # make `odoo-db` available globally
Usage
odoo-db [OPTIONS] COMMAND [DB]
Global options:
| Option | Default | Description |
|---|---|---|
--output-file |
- (stdout) |
Write output to file |
--output-format |
text |
Output format: text, json, prometheus |
--log-level |
WARNING |
Logging level: DEBUG, INFO, WARNING, ERROR |
--log-file |
logs/odoo-db.log |
Log file path (auto-created) |
Commands:
| Command | Description |
|---|---|
list |
List all Odoo DBs with version and neutralization status |
modules <db> |
List installed modules with version |
crons <db> |
List active scheduled actions |
jobs <db> |
Queue job counts by state (requires queue_job module) |
users <db> |
List active users with connection status |
locks <db> |
Show active PostgreSQL locks |
stats <db> |
Per-table record counts and sizes by year (--years N, --top N) |
not-odoo <db> |
Show non-Odoo database objects: custom views, triggers, functions, and stored procedures. Triggers/functions are tagged recognized (known infra: unaccent, queue_job_notify, …) or custom |
prepare-audit <db> |
Bundle summary + modules + model_owners + orphan_tables + stats + not-odoo into <db>.json (in the current directory) for /odoo-dev:audit-db (--years N, --top N; --top 0 means all tables). orphan_tables flags tables not owned by any installed module (reason: uninstalled_module or no_ownership_data) |
Examples
# List all local Odoo databases
odoo-db list
# Verbose: also show module count and user count
odoo-db list --verbose
# Output as JSON
odoo-db --output-format json list
# Export prometheus metrics to file
odoo-db --output-format prometheus --output-file /tmp/odoo.prom list
# Show installed modules for a specific database
odoo-db modules my_db
# Show queue jobs
odoo-db jobs my_db
# Per-table stats: record counts and sizes for last 3 years
odoo-db stats my_db
# Top 10 tables, last 5 years
odoo-db stats my_db --top 10 --years 5
# Debug mode with full logging
odoo-db --log-level debug list
# Show non-Odoo objects: custom views, triggers, functions, stored procedures
odoo-db not-odoo my_db
# Export not-odoo report as JSON
odoo-db --output-format json not-odoo my_db
# Prepare an audit bundle (writes ./my_db.json in the current directory)
odoo-db prepare-audit my_db
# Custom output path
odoo-db --output-file /tmp/audit.json prepare-audit my_db
Dev
make install # Install deps + pre-commit hooks
make check # Lint, format, type-check
make test # Run tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_db-1.6.0.tar.gz.
File metadata
- Download URL: odoo_db-1.6.0.tar.gz
- Upload date:
- Size: 26.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ae54ec929b618905b71d0cf8cf17bf912f67d5ab19039c205fa8ce7d2311743
|
|
| MD5 |
7f028f51dea497ebaff395f636e331b0
|
|
| BLAKE2b-256 |
f9084dec81ed817323e6f65808725a58d8805b31e84f109563da203c91416465
|
Provenance
The following attestation bundles were made for odoo_db-1.6.0.tar.gz:
Publisher:
release.yaml on trobz/odoo-db
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odoo_db-1.6.0.tar.gz -
Subject digest:
1ae54ec929b618905b71d0cf8cf17bf912f67d5ab19039c205fa8ce7d2311743 - Sigstore transparency entry: 1566881966
- Sigstore integration time:
-
Permalink:
trobz/odoo-db@3ea24817f400c594e2f8fae5354e96e88ab5f78f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/trobz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@3ea24817f400c594e2f8fae5354e96e88ab5f78f -
Trigger Event:
push
-
Statement type:
File details
Details for the file odoo_db-1.6.0-py3-none-any.whl.
File metadata
- Download URL: odoo_db-1.6.0-py3-none-any.whl
- Upload date:
- Size: 26.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81c3f6a81d39757071da52807059285b7593af0aec66e1967d6a50b61c0917eb
|
|
| MD5 |
e4c798669408ac1d06001c47e9490603
|
|
| BLAKE2b-256 |
0e16aab616d0d69c4f40290e4ba7abcded9928868aee98f76764e73f58075b4c
|
Provenance
The following attestation bundles were made for odoo_db-1.6.0-py3-none-any.whl:
Publisher:
release.yaml on trobz/odoo-db
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odoo_db-1.6.0-py3-none-any.whl -
Subject digest:
81c3f6a81d39757071da52807059285b7593af0aec66e1967d6a50b61c0917eb - Sigstore transparency entry: 1566882026
- Sigstore integration time:
-
Permalink:
trobz/odoo-db@3ea24817f400c594e2f8fae5354e96e88ab5f78f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/trobz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@3ea24817f400c594e2f8fae5354e96e88ab5f78f -
Trigger Event:
push
-
Statement type: