Skip to content

[19.0][FIX] database_cleanup: Avoid blocking uninstall during purge modules - #3669

Open
quoc-pn wants to merge 1 commit into
OCA:19.0from
komit-consulting:19.0-database_cleanup-uninstall-blocking-purge-modules
Open

[19.0][FIX] database_cleanup: Avoid blocking uninstall during purge modules#3669
quoc-pn wants to merge 1 commit into
OCA:19.0from
komit-consulting:19.0-database_cleanup-uninstall-blocking-purge-modules

Conversation

@quoc-pn

@quoc-pn quoc-pn commented Jul 14, 2026

Copy link
Copy Markdown
Member

Problems

The button_immediate_uninstall() method raises a UserError when any module is in one of the following states: to install, to upgrade, or to remove.

In the purge module workflow, modules to remove are updated to to remove before button_immediate_uninstall() is called to uninstall the installed modules. This causes the uninstall process to fail because the presence of modules in the to remove state blocks button_immediate_uninstall().

Changes

Remove the logic that explicitly marks modules as to remove.

Use module_uninstall() instead of button_immediate_uninstall() to uninstall modules. Unlike button_immediate_uninstall(), module_uninstall() does not set the module state to to remove, allowing modules to be unlinked successfully.

Note: The _unlink_except_installed() method prevents unlinking modules whose state is one of the following: installed, to upgrade, to remove, or to install.

@pedrobaeza pedrobaeza added this to the 19.0 milestone Jul 14, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

Please check CI and remove [19.0] from the commit message.

@quoc-pn
quoc-pn force-pushed the 19.0-database_cleanup-uninstall-blocking-purge-modules branch from 411e350 to 9d145b2 Compare July 14, 2026 07:16
@quoc-pn quoc-pn changed the title [19.0][FIX] database_cleanup: Avoid blocking uninstall during purge modules [FIX] database_cleanup: Avoid blocking uninstall during purge modules Jul 14, 2026
@quoc-pn quoc-pn changed the title [FIX] database_cleanup: Avoid blocking uninstall during purge modules [19.0][FIX] database_cleanup: Avoid blocking uninstall during purge modules Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants