erplibre/script/odoo/migration
Mathieu Benoit 7296a03179 [FIX] migration: repair, replay, and know when to stop
The failure that stops an upgrade is almost always the same one — a COW
copy left behind on the previous version — and the repair is known. So
Enter now repairs, and a repair that actually changed something replays
the command by itself.

A default that acts must know when to stop, and here it must twice over.
Repairing when there is nothing left to repair, then offering it again,
loops without end: measured, « no COW copy has drifted » over and over.
And a repair that does not help would replay the command forever. Three
attempts, then the prompt says plainly that this one needs a developer.

The turn counter is deliberately redundant with that logic: both guard
the same failure, but the counter holds even if the logic is broken one
day by accident. An endless loop in an unattended migration costs a
night.

Also: the smoke tool forced `ask=input` on its own prompt, which
short-circuited auto-run — the question waited for a keystroke nobody
was there to give.

--- FR ---

[FIX] migration : réparer, rejouer, et savoir s'arrêter

L'échec qui arrête une migration est presque toujours le même — une copie
COW restée sur la version d'avant — et la réparation est connue. Entrée
répare donc, et une réparation qui a vraiment changé quelque chose rejoue
la commande d'elle-même.

Un défaut qui agit doit savoir s'arrêter, et ici deux fois plutôt qu'une.
Réparer quand il n'y a plus rien à réparer, puis le reproposer, boucle
sans fin : mesuré, « Aucune copie COW n'a dérivé », encore et encore. Et
une réparation qui ne suffit pas rejouerait indéfiniment. Trois
tentatives, puis l'invite dit qu'il faut un développeur.

Le compteur de tours double volontairement cette logique : il tient même
si elle est cassée un jour par mégarde.

Assisted-by: Claude Opus 5
2026-08-22 07:23:59 -04:00
..
check_cow_views.py [FIX] migration: the COW tools speak the system language 2026-08-22 07:23:59 -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
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
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 [ADD] migration: browse the drifted COW copies full screen 2026-08-22 07:23:59 -04:00
smoke_internal_ui.py [ADD] migration: open /my as the test user, and blame the right request 2026-08-22 07:23:59 -04:00
smoke_public_url.py [FIX] migration: repair, replay, and know when to stop 2026-08-22 07:23:59 -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 [IMP] todo support odoo upgrade 2025-10-31 01:43:26 -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