Compare commits

...

3 Commits

Author SHA1 Message Date
Stéphan Sainléger
81e036cd4a [FIX] finalize_db: only reset `to upgrade modules, not to install`
The pre-shell state reset in ``scripts/finalize_db.sh`` forced both
``to upgrade`` and ``to install`` modules to ``installed``. Forcing
``to install`` to ``installed`` makes Odoo skip their install scripts
entirely (tables, ``noupdate`` data, init hooks never run), leaving
ghost "installed but empty" modules that the final ``-u all`` cannot
recover.

Restrict the reset to ``to upgrade`` only, whose real update is honored
by the controlled ``-u all`` at the end of the script. Also drop the
dead ``NOT IN (... state = 'uninstalled')`` sub-query: ``name`` is
unique so a module never has two states, making the filter a no-op.

A commented-out ``SELECT`` is added to trace pending-upgrade modules if
the trailing ``-u all`` is ever removed.
2026-07-03 23:06:12 +02:00
Stéphan Sainléger
aa48543a12 [FIX] remove useless and destructive website template cleaning 2026-07-03 22:47:32 +02:00
Stéphan Sainléger
9cbb5eaff2 [IMP] add project_deadline in "merged in core" modules in 15.0 2026-07-03 22:43:16 +02:00
2 changed files with 20 additions and 12 deletions

View File

@@ -12,17 +12,6 @@ CLEANUP_SQL=$(cat <<'EOF'
DROP SEQUENCE IF EXISTS base_registry_signaling; DROP SEQUENCE IF EXISTS base_registry_signaling;
DROP SEQUENCE IF EXISTS base_cache_signaling; DROP SEQUENCE IF EXISTS base_cache_signaling;
-- Reset website templates to their original state.
-- Views with arch_fs (file source) that have been customized (arch_db not null)
-- are reset to use the file version, EXCEPT for actual website pages which
-- contain user content that must be preserved.
UPDATE ir_ui_view
SET arch_db = NULL
WHERE arch_fs IS NOT NULL
AND arch_fs LIKE 'website/%'
AND arch_db IS NOT NULL
AND id NOT IN (SELECT view_id FROM website_page);
-- Purge compiled frontend assets (CSS/JS bundles). -- Purge compiled frontend assets (CSS/JS bundles).
-- These cached files reference old asset versions and must be regenerated -- These cached files reference old asset versions and must be regenerated
-- by Odoo after migration to avoid broken stylesheets and scripts. -- by Odoo after migration to avoid broken stylesheets and scripts.
@@ -34,6 +23,24 @@ EOF
) )
query_postgres_container "$CLEANUP_SQL" "$DB_NAME" query_postgres_container "$CLEANUP_SQL" "$DB_NAME"
# Reset modules still marked as 'to upgrade' before launching the Odoo shell
# scripts below. Loading the registry in `odoo shell` re-triggers the upgrade
# of these modules, which can fail on broken views (e.g. website_sale
# TypeError). The controlled `-u all` at the end of this script performs the
# real update afterwards. We deliberately do NOT touch 'to install' modules:
# forcing them to 'installed' would skip their install scripts entirely.
#
# Uncomment the SELECT below to trace which modules were pending upgrade
# before we neutralize their state (useful if the `-u all` above is removed).
# query_postgres_container "
# SELECT name FROM ir_module_module WHERE state = 'to upgrade' ORDER BY name;
# " "$DB_NAME" || true
query_postgres_container "
UPDATE ir_module_module
SET state = 'installed'
WHERE state = 'to upgrade';
" "$DB_NAME" || true
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PYTHON_SCRIPT="${SCRIPT_DIR}/lib/python/fix_duplicated_views.py" PYTHON_SCRIPT="${SCRIPT_DIR}/lib/python/fix_duplicated_views.py"
@@ -77,7 +84,7 @@ fi
# Launch Odoo with database in finale version to run all updates # Launch Odoo with database in finale version to run all updates
run_compose --debug run "$ODOO_SERVICE" -u all --log-level=debug --stop-after-init --no-http run_compose --debug run "$ODOO_SERVICE" -u all --log-level=debug --stop-after-init --no-http --load=base,web,openupgrade_framework
echo "" echo ""
echo "Running post-migration view validation..." echo "Running post-migration view validation..."

View File

@@ -8,6 +8,7 @@ obsolete:
# Modules merged into Odoo Core in version 15.0 # Modules merged into Odoo Core in version 15.0
merged_in_core: merged_in_core:
- project_category - project_category
- project_deadline
# Modules renamed in version 15.0 # Modules renamed in version 15.0
renamed: renamed: