Repository navigation
[OU-FIX] base: uninstall theme_common when its manifest is gone - #13
Merged
Merged
Conversation
Co-authored-by: André de Kock <[email protected]>
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.
Symptom
theme_commonis left in stateto upgrade. It has noapriorientry. The module existed through design-themes 19.0 (a hidden snippets library depending onwebsite, data underviews/old_snippets/) and the directory is gone in design-themes 20.0.Root cause
button_upgradecallsget_module_info(name).get("installable", True). A missing manifest is{}, soinstallabledefaults to True, andcheck_external_dependenciescallsManifest.for_addonwith warnings on. That logsmanifest not found. The row staysto upgradebecause the module is never loaded and never uninstalled. OpenUpgrade's historical handling of a removed module is anapriorientry consumed by the base migration (merged_modules/renamed_modules). Nothing listedtheme_common.Merging it into
websitewould reassign its xmlids ontowebsiteand keep the obsolete snippets. The snippets were removed, so the module should be uninstalled and its views and assets deleted.Change
openupgrade_scripts/apriori.pygains:openupgrade_scripts/scripts/base/20.0.1.3/pre-migration.pysets those modules frominstalled/to upgrade/to installtoto remove. At the end of the registry load, Odoo callsmodule_uninstallforto removerows that are not in the module graph. That runsir.model.data._module_data_uninstall(views, assets, and the rest of the module's xmlid data) and sets the state touninstalled.button_upgraderuns before any migration script, so the onemanifest not foundline from that call can still appear. The row does not stayto upgrade. While the graph is built, the empty manifest is skipped as not installable (display_warning=Falsethere, so that path does not repeat the manifest warning).Fork
20.0has the sparseapriori.pyand no base pre-migration yet (OCA OCA#6068 / OCA#6077, already on20.0-integration, add the filled apriori and the full base script). This PR addsremoved_modulesto the sparse file and a pre-migration whose only step is the uninstall. On20.0-integration, appendremoved_modulesto the filled apriori and call_remove_obsolete_modulesat the end of the existing basemigrate().Verification
Confirmed
theme_commonexists on design-themes 16.0–19.0 and returns 404 on 20.0. Confirmed Odoo 20button_upgrade,ModuleGraph.extendandmodule_uninstallagainst the sources cited above.ruffis clean. No database upgrade was run.Searched OpenUpgrade history for
theme_commoninapriori.py: no previous entry. No OCA pull request adds one for 20.0.Upstream
Generic for any database that had the Odoo design theme. Submit to OCA
20.0on top of OCA#6068 and the filled apriori (OCA#6077). Not applicable before 20.0 (theme_commonstill ships).Limitations
manifest not foundline frombutton_upgradeitself is not silenced. Silencing it means patchingbutton_upgrade, which runs beforeaprioriis applied.ir.ui.view.keyliketheme_common.%) are removed bybutton_uninstall's_remove_copied_views, which the end-of-loadmodule_uninstallpath does not call. Xmlid-backed views and assets are removed.theme_commonis not uninstalled with it.module_uninstalldoes not walk downstream dependencies. 20.0 theme manifests no longer depend ontheme_common.