[18.0][OU-FIX] base: align extension view types with their parent#17
Open
eantones wants to merge 1 commit into
Open
[18.0][OU-FIX] base: align extension view types with their parent#17eantones wants to merge 1 commit into
eantones wants to merge 1 commit into
Conversation
Old databases carry extension views (mode='extension') whose stored
``type`` doesn't match their parent view's: older Odoo versions stored a
wrong derivation (e.g. the 'form' default on a list-view extension, or
'tree' on a search-view extension) and never validated it. Odoo 18
validates the resolved arch root against ``type`` on every module
update, so each of these rows becomes a hard ParseError the first time
its module is updated after the migration ("The root node of a form
view must be <form>, not <list>").
Align them with the parent's type — the invariant an extension view
must satisfy — right after the tree->list rename, so the alignment
lands on the renamed values.
Found on a live 14->18 migration: two such rows (a list-view extension
typed 'form' since 2024, a search-view extension typed 'tree'), both
written by normal module updates on the source database years before
the migration.
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.
Old databases carry extension views (
mode='extension') whose storedtypedoesn't match their parent view's: older Odoo versions stored a wrong derivation (e.g. theformdefault on a list-view extension, ortreeon a search-view extension) and never validated it. Odoo 18 validates the resolved arch root againsttypeon every module update, so each of these rows becomes a hardParseErrorthe first time its owning module is updated after the migration:The invariant an extension view must satisfy is simply "same type as its parent" — this adds
_align_extension_view_types()to the base 18.0.1.3 pre-migration, right after the existing tree→list rename so the alignment lands on the renamed values.Found on a live 14→18 migration: two such rows (a list-view extension typed
formwritten in 2024, a search-view extension typedtreewritten in 2026), both produced by normal module updates on the source database years before the migration, harmless on every version before 18.