erplibre/script/odoo/migration
Mathieu Benoit 651cfd4583 [ADD] migration: retirer les index qu'Odoo 17 a créés en double
`make_index_name` rend `{table}__{colonne}_index` depuis la 17 — deux
soulignés. Le nouvel index est créé, l'ancien reste. Mesuré sur une
chaîne 12 → 18 : 1 paire en 12, 3 en 16, 370 en 17, 365 en 18. Inerte à
la lecture, coûteux à l'écriture — deux arbres B entretenus à chaque
INSERT — et c'est le seul défaut de la famille qui empire tout seul.

L'outil s'abstient plus qu'il ne supprime : contrainte, clé primaire,
index partiel ou calculé, méthode ou classe d'opérateurs différentes,
convention non reconnaissable. Sur la base réelle, 367 sûrs sur 376.

Éprouvé sur une copie : 364 retirés, 10 Mo libérés, les 6301 contraintes
identiques au nom près, Odoo charge sans une ligne de journal, et un
« -u all » complet n'en recrée aucun.

--- EN ---

`make_index_name` returns `{table}__{column}_index` since 17 — two
underscores. The new index is created, the old one stays. Measured on a
12 → 18 chain: 1 pair in 12, 3 in 16, 370 in 17, 365 in 18. Inert on
read, costly on write — two B-trees maintained per INSERT — and the only
defect of this family that worsens on its own.

The tool abstains more than it drops: constraint, primary key, partial or
computed index, differing access method or operator class, unrecognisable
convention. On the real database, 367 safe out of 376.

Proven on a copy: 364 dropped, 10 MB freed, the 6301 constraints
identical name for name, Odoo loads without a single log line, and a full
« -u all » recreates none of them.

Assisted-by: Claude Opus 5
2026-08-25 03:19:18 -04:00
..
check_cow_views.py [ADD] migration: prédire la copie de site qui rendra 500 après le palier 2026-08-25 03:19:18 -04:00
check_hidden_models.py [ADD] migration: repair DMS at the 13 bump, and catch the whole class 2026-08-22 07:24:00 -04:00
check_stale_scss.py [ADD] migration: make Enter mean the answer you always give 2026-08-22 07:23:59 -04:00
check_stale_scss_tui.py [ADD] migration: read the stale SCSS, then fix it, without leaving the tool 2026-08-22 07:23:59 -04:00
cow_drift.py [FIX] script: make the analysis and migration tools executable 2026-08-22 07:23:59 -04:00
cow_drift_tui.py [FIX] script: make the analysis and migration tools executable 2026-08-22 07:23:59 -04:00
database_cleanup.py [FIX] database_cleanup: purge the batch, and say what you are doing 2026-08-22 07:23:59 -04:00
dms_access_repair.py [ADD] migration: repair DMS at the 13 bump, and catch the whole class 2026-08-22 07:24:00 -04:00
fix_cow_render.py [ADD] migration: réparer les copies de site qui ne savent plus se rendre 2026-08-25 03:19:18 -04:00
fix_duplicate_index.py [ADD] migration: retirer les index qu'Odoo 17 a créés en double 2026-08-25 03:19:18 -04:00
fix_migration_odoo120_to_odoo130.sql [ADD] migration: decode percent-encoded page anchors before the 13 bump 2026-08-23 02:20:19 -04:00
fix_migration_odoo130_to_odoo140.sql [ADD] migration: see and repair the website COW views 2026-08-10 03:10:50 -04:00
fix_migration_odoo140_to_odoo150.py [FIX] script: make the analysis and migration tools executable 2026-08-22 07:23:59 -04:00
fix_migration_odoo170_to_odoo180.sql [ADD] migration: offer the theme uninstall where the theme is blamed 2026-08-22 07:24:00 -04:00
fix_view_type.py [ADD] migration: convert the <tree> tags Odoo 18 renamed to <list> 2026-08-22 07:24:00 -04:00
neutralize_cow_views.py [FIX] migration: the COW tools speak the system language 2026-08-22 07:23:59 -04:00
README.base.md [ADD] migration: see and repair the website COW views 2026-08-10 03:10:50 -04:00
README.fr.md [ADD] migration: see and repair the website COW views 2026-08-10 03:10:50 -04:00
README.md [ADD] migration: see and repair the website COW views 2026-08-10 03:10:50 -04:00
reset_stale_cow_tui.py [ADD] migration: browse the drifted COW copies full screen 2026-08-22 07:23:59 -04:00
reset_stale_cow_views.py [FIX] smoke: judge the back office AFTER the repair, and say why it failed 2026-08-22 07:23:59 -04:00
smoke_internal_ui.py [FIX] smoke: judge the back office AFTER the repair, and say why it failed 2026-08-22 07:23:59 -04:00
smoke_public_url.py [FIX] smoke: two sites still unpacked three fields from the failure tuple 2026-08-23 02:07:42 -04:00
snapshot_cow_views.py [FIX] migration: the COW tools speak the system language 2026-08-22 07:23:59 -04:00
uninstall_module_list_odoo140_to_odoo150.txt [FIX] migration: retirer web_responsive avant de monter en 18 2026-08-23 02:20:27 -04:00
uninstall_module_list_odoo170_to_odoo180.txt [FIX] migration: retirer web_responsive avant de monter en 18 2026-08-23 02:20:27 -04:00

Migration

Run this script when doing database migration. Example :

source ./.venv.odoo15.0_python3.8.20/bin/activate && cat ./script/odoo/migration/fix_migration_odoo140_to_odoo150.py | ./odoo15.0/odoo/odoo-bin shell -d DATABASE

Check uninstall_module_list_odoo140_to_odoo150.txt

Module lists to uninstall

Before a version bump, the migration uninstalls the modules listed in uninstall_module_list_odoo<from>_to_odoo<to>.txt. Two locations are read, the private one first, and the results are merged (duplicates dropped):

  1. private/odoo/migration/<database>/uninstall_module_list_odooXX0_to_odooYY0.txt — specific to ONE database, not versioned. Which modules must be dropped depends on the data, so this is where nearly every entry belongs.
  2. script/odoo/migration/uninstall_module_list_odooXX0_to_odooYY0.txt — shared defaults, versioned, valid for every database.

Syntax: one module per line, with a justification after #. Commas and several names per line are accepted; blank lines and full-line comments are ignored. A module without a stated reason is flagged at runtime: removing a module is a decision someone must be able to review later.

queue_job                        # blocks 12->13, trigger queue_job_notify
mgmtsystem_hazard                # not ported to 13.0
web_syncer                       # dropped upstream