Repository navigation
refactor: let Odoo's CLI do the database work at start - #2
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 runsodoo module upgrade --outdated all. This roughly halves what the fork adds to dockerdoo.Behavior changes
AUTO_UPGRADEnow relies on Odoo's own version check. Each start withAUTO_UPGRADE=1loads the registry once, instead of skipping that when no manifest changed.INIT_MODULESapplies only when the database is created. Apps added later are installed from Odoo.AUTO_UPGRADE_SNAPSHOTandINIT_LOAD_LANGUAGESare removed. Use platform backups for rollback, andINIT_LANGUAGE, which works withes_DOandl10n_doon current 20.0.odoo, instead of walking the filestore on every start.20.0and20.0.YYYYMMDDare published;20.0-YYYYMMDDis dropped.The hosted-platform test keeps the same coverage in about half the code.