Skip to content

refactor: let Odoo's CLI do the database work at start - #2

Merged
gustavovalverde merged 1 commit into
mainfrom
simplify
Oct 17, 2026
Merged

gustavovalverde merged 1 commit into
mainfrom
simplify

Conversation

@gustavovalverde

Copy link
Copy Markdown

Follow-up to #1. The start step reimplemented work Odoo 20's CLI already does. It now waits for PostgreSQL, creates the application role from DB_ADMIN_URL, and, under the advisory lock, either creates a missing database (odoo db init, odoo module install) or runs odoo module upgrade --outdated all. This roughly halves what the fork adds to dockerdoo.

Behavior changes

  • AUTO_UPGRADE now relies on Odoo's own version check. Each start with AUTO_UPGRADE=1 loads the registry once, instead of skipping that when no manifest changed.
  • INIT_MODULES applies only when the database is created. Apps added later are installed from Odoo.
  • A failed first install drops the new database, so the next start begins again instead of serving a half-installed database.
  • AUTO_UPGRADE_SNAPSHOT and INIT_LOAD_LANGUAGES are removed. Use platform backups for rollback, and INIT_LANGUAGE, which works with es_DO and l10n_do on current 20.0.
  • A database that exists but is not an Odoo database is no longer detected.
  • A root start now changes ownership only when the data directory is not owned by odoo, instead of walking the filestore on every start.
  • Only 20.0 and 20.0.YYYYMMDD are published; 20.0-YYYYMMDD is dropped.

The hosted-platform test keeps the same coverage in about half the code.

The start step now waits for PostgreSQL, creates the application role,
and under the advisory lock either creates a missing database with
odoo db init and odoo module install or runs odoo module upgrade
--outdated. Odoo already compares manifest versions and refreshes the
module list, so the hand-written planner, database states, snapshot
option, apps-list refresh, and language step are gone. A failed first
install drops the database so the next start begins again.

A root start now changes ownership only when the data directory is not
owned by odoo, instead of walking the filestore on every start.
@gustavovalverde
gustavovalverde merged commit e6e8af0 into main Oct 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant