[17.0][OU-FIX] website_sale: drop stale payment_footer template with its inherit closure#18
Closed
eantones wants to merge 1 commit into
Closed
[17.0][OU-FIX] website_sale: drop stale payment_footer template with its inherit closure#18eantones wants to merge 1 commit into
eantones wants to merge 1 commit into
Conversation
Odoo 17 removed the website_sale.payment_footer template (payment page redesign). The framework's end-of-pass obsolete-record cleanup DELETEs the leftover ir_ui_view row one record at a time, so it can hit the ir_ui_view_inherit_id_fkey FK when a view inheriting it is scheduled for deletion later in the same pass — order-dependent; the stale 16.0 template then survives into the 17.0 database (observed on two production dumps, 2026-07). Delete it here (post-migration, runs before the cleanup), children first, in a single recursive-CTE statement (FK constraints are checked at statement end, so the whole closure deletes atomically), keyed on the stable view key — idempotent and dump-independent (record ids shift between dumps).
Member
Author
|
Superseded by the core fix (nuobit/odoo#9 for 17.0, nuobit/odoo#10 for 18.0). This PR cleaned up the orphaned |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Odoo 17 removed the
payment_footertemplate fromwebsite_sale(payment page redesign), but on databases coming from 16.0 the record survives the upgrade whenever another view inherits it.The end-of-pass obsolete-record cleanup deletes records one statement at a time, so
ir_ui_view_inherit_id_fkeyblocks the template's DELETE when an inheriting view (website COW copies included) is scheduled for deletion later in the same pass. The delete fails as a logged "bad query", and the stale 16.0 markup survives into the 17.0 database.Fix in the migration itself: a
post-zzscript forwebsite_sale17.0.1.1 that deletes the template together with its whole inherit closure in ONE recursive-CTE statement per table (ir.model.datafirst, thenir_ui_view). FK checks run at statement end, which makes the closure delete atomic. Keyed on the stable viewkey, so it is idempotent and immune to record-id drift between dumps (observed: the same view landed on id 6694 in one dump and 6740 in a fresh one).Validated on a real 16.0 → 17.0 OpenUpgrade run (production-size database, website in use): the script deleted the template plus one inheriting child (2
ir.model.datarows + 2ir_ui_viewrows) and the "bad query" line disappeared from the hop log; the 17.0 database ends with nowebsite_sale.payment_footerleftovers.