Repository navigation
fix: initialize Odoo database before service start - #21
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d81f35036a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| exit 1 | ||
| fi | ||
| echo "Recreating uninitialized database $ODOO_DATABASE_NAME with UTF8 encoding." | ||
| sudo -u postgres dropdb "$ODOO_DATABASE_NAME" |
There was a problem hiding this comment.
Avoid dropping non-Odoo databases
When ODOO_DATABASE_NAME points at an existing non-UTF8 database that is not an Odoo database, this path treats the absence of public.ir_module_module as proof that it is safe to recreate and then runs dropdb. That can delete unrelated data on hosts that already have a database with the configured name, which is plausible because initialization is enabled by default and the name is user-configurable; please verify the database is empty or explicitly owned/created by this installer before dropping it.
Useful? React with 👍 / 👎.
| ; This is the password that allows database operations: | ||
| admin_passwd = ${OE_SUPERADMIN} | ||
| ${ODOO_PORT_CONFIG} | ||
| db_name = ${ODOO_DATABASE_NAME} |
There was a problem hiding this comment.
Do not force db_name when initialization is disabled
Even when INITIALIZE_ODOO_DATABASE="False", the generated Odoo config now always includes db_name = odoo by default. In that disabled-initialization scenario the script no longer preserves the previous behavior of allowing Odoo's database manager or existing databases with other names to be used, so disabling the new feature still leaves installations filtered to a single database unless users also discover and override ODOO_DATABASE_NAME.
Useful? React with 👍 / 👎.
90cc0d2
into
fix/source-addons-path-includes-base
Summary
basemodule once with--without-demo=all --stop-after-initINITIALIZE_ODOO_DATABASEandODOO_DATABASE_NAMEsettingsDependency
Stacked on PR #20 / branch
fix/source-addons-path-includes-basebecause database initialization depends on the corrected source-installaddons_pathcontaining Odoo core modules such asbase.Test Plan
python3 -m unittest tests/test_installer_features.py -vbash -n odoo_install.shscripts/validate.shgit diff --check