erplibre/script/odoo/migration/README.base.md
Mathieu Benoit 4536c5bc40 [IMP] migration: per-database uninstall list, with a stated reason
Which modules must be uninstalled before a version bump depends on the data of
one specific database, so that list does not belong to a shared versioned file.

- Read private/odoo/migration/<database>/uninstall_module_list_odooXX0_to_odooYY0.txt
  first, then the shared versioned defaults under script/odoo/migration/, and
  merge them (duplicates dropped). private/ mirrors script/, the convention
  already used by script/todo/todo.json -> private/todo/todo_override.json.
- Fix the parser. It was « f.readline().split() »: only the FIRST line was kept,
  so a multi-line list was silently truncated, and a comma-separated list turned
  into one bogus module name. On a file starting with a comment it returned the
  words of that comment as module names. It now reads every line and accepts
  commas, several names per line, blank lines and comments.
- Support a « # reason » justification per module, printed before uninstalling;
  a module with no reason is flagged. Removing a module must stay reviewable.
- Ignore private/odoo/ in git: these lists describe one database.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-31 23:25:43 -04:00

2.7 KiB

Migration

Run this script when doing database migration. Example :

Migration

Exécutez ce script lors de la migration de base de données. Exemple :

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.

Consultez uninstall_module_list_odoo140_to_odoo150.txt

Listes de modules à désinstaller

Avant une montée de version, la migration désinstalle les modules listés dans uninstall_module_list_odoo<depuis>_to_odoo<vers>.txt. Deux emplacements sont lus, le privé d'abord, puis fusionnés (doublons éliminés) :

  1. private/odoo/migration/<base>/uninstall_module_list_odooXX0_to_odooYY0.txt — propre à UNE base de données, non versionné. Les modules à supprimer dépendent des données : c'est ici que va la quasi-totalité des entrées.
  2. script/odoo/migration/uninstall_module_list_odooXX0_to_odooYY0.txt — valeurs par défaut partagées, versionnées, valables pour toute base.

Syntaxe : un module par ligne, avec une justification après #. Les virgules et plusieurs noms par ligne sont acceptés ; lignes vides et commentaires pleine ligne sont ignorés. Un module sans raison est signalé à l'exécution : supprimer un module est une décision qui doit pouvoir être relue plus tard.

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