Skip to content

[OU-FIX] base: uninstall theme_common when its manifest is gone - #13

Merged
cursor[bot] merged 1 commit into
20.0from
cursor/ou-20-07-theme-common-3e8f
Nov 12, 2026
Merged

cursor[bot] merged 1 commit into
20.0from
cursor/ou-20-07-theme-common-3e8f

Conversation

@adekock11

Copy link
Copy Markdown
Owner

Symptom

module theme_common: manifest not found

theme_common is left in state to upgrade. It has no apriori entry. The module existed through design-themes 19.0 (a hidden snippets library depending on website, data under views/old_snippets/) and the directory is gone in design-themes 20.0.

Root cause

button_upgrade calls get_module_info(name).get("installable", True). A missing manifest is {}, so installable defaults to True, and check_external_dependencies calls Manifest.for_addon with warnings on. That logs manifest not found. The row stays to upgrade because the module is never loaded and never uninstalled. OpenUpgrade's historical handling of a removed module is an apriori entry consumed by the base migration (merged_modules / renamed_modules). Nothing listed theme_common.

Merging it into website would reassign its xmlids onto website and keep the obsolete snippets. The snippets were removed, so the module should be uninstalled and its views and assets deleted.

Change

openupgrade_scripts/apriori.py gains:

removed_modules = [
    # odoo/design-themes: snippets library removed in 20.0, not folded into website
    "theme_common",
]

openupgrade_scripts/scripts/base/20.0.1.3/pre-migration.py sets those modules from installed / to upgrade / to install to to remove. At the end of the registry load, Odoo calls module_uninstall for to remove rows that are not in the module graph. That runs ir.model.data._module_data_uninstall (views, assets, and the rest of the module's xmlid data) and sets the state to uninstalled.

button_upgrade runs before any migration script, so the one manifest not found line from that call can still appear. The row does not stay to upgrade. While the graph is built, the empty manifest is skipped as not installable (display_warning=False there, so that path does not repeat the manifest warning).

Fork 20.0 has the sparse apriori.py and no base pre-migration yet (OCA OCA#6068 / OCA#6077, already on 20.0-integration, add the filled apriori and the full base script). This PR adds removed_modules to the sparse file and a pre-migration whose only step is the uninstall. On 20.0-integration, append removed_modules to the filled apriori and call _remove_obsolete_modules at the end of the existing base migrate().

Verification

Confirmed theme_common exists on design-themes 16.0–19.0 and returns 404 on 20.0. Confirmed Odoo 20 button_upgrade, ModuleGraph.extend and module_uninstall against the sources cited above. ruff is clean. No database upgrade was run.

Searched OpenUpgrade history for theme_common in apriori.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.0 on top of OCA#6068 and the filled apriori (OCA#6077). Not applicable before 20.0 (theme_common still ships).

Limitations

  • The manifest not found line from button_upgrade itself is not silenced. Silencing it means patching button_upgrade, which runs before apriori is applied.
  • Copied views with no xmlid (ir.ui.view.key like theme_common.%) are removed by button_uninstall's _remove_copied_views, which the end-of-load module_uninstall path does not call. Xmlid-backed views and assets are removed.
  • Another module that still depends on theme_common is not uninstalled with it. module_uninstall does not walk downstream dependencies. 20.0 theme manifests no longer depend on theme_common.
Open in Web Open in Cursor 

@cursor
cursor Bot merged commit 717e508 into 20.0 Nov 12, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants