Skip to content

[18.0][OU-FIX] base: make the legacy module-state snapshot resume-friendly#10

Open
eantones wants to merge 2 commits into
18.0from
18.0-fix-resume-idempotent-legacy-table
Open

[18.0][OU-FIX] base: make the legacy module-state snapshot resume-friendly#10
eantones wants to merge 2 commits into
18.0from
18.0-fix-resume-idempotent-legacy-table

Conversation

@eantones

@eantones eantones commented Jul 7, 2026

Copy link
Copy Markdown
Member

The 18.0.1.3 pre-migration CREATEs the legacy ir_module_module snapshot table unguarded. When a run crashes after this script's transaction was committed but before base's version bump (e.g. an external-dependency UserError at button_upgrade), the standard restart-and-resume re-runs the script and dies on DuplicateTable.

CREATE TABLE IF NOT EXISTS keeps the first capture on resume — which is the correct pre-upgrade snapshot: recapturing at that point would record module states with the renames/merges already applied. The rest of the script is already re-run tolerant (update_module_names no-ops on absent old names).

Hit on a real 17→18 resume (crash #1 was an unrelated missing python dep at button_upgrade). Upstreamable as-is.

eantones added 2 commits July 7, 2026 12:41
The 18.0.1.3 pre-migration CREATEs the legacy ir_module_module snapshot
table unguarded. When a run crashes after this script's transaction was
committed but before base's version bump (e.g. an external-dependency
UserError at button_upgrade), the standard restart-and-resume re-runs
the script and dies on DuplicateTable.

Use CREATE TABLE IF NOT EXISTS so the resume keeps the first capture —
which is the correct pre-upgrade snapshot: recapturing at that point
would record module states with the renames/merges below already
applied. The rest of the script is already re-run tolerant
(update_module_names no-ops on absent old names).
Second statement of the same resume scenario: copy_columns ADDs the
legacy ir_act_window_view.view_mode column unguarded, so a resumed run
that already committed it dies on DuplicateColumn. Skip the copy when
the legacy column already exists — its content from the first attempt
is the correct pre-upgrade capture. The remaining statements of this
script are already re-run tolerant (WHERE-guarded UPDATEs and no-op
renames).
@eantones eantones added the upstream-candidate Generic fix, submit to OCA/OpenUpgrade when validated label Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream-candidate Generic fix, submit to OCA/OpenUpgrade when validated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant