diff --git a/src/util/modules.py b/src/util/modules.py index d55500313..7c06c8ed0 100644 --- a/src/util/modules.py +++ b/src/util/modules.py @@ -310,7 +310,8 @@ def uninstall_theme(cr, theme, base_theme=None): for website in websites: IrModuleModule._theme_remove(website) flush(env_["base"]) - with warnings.catchwarnings(action="ignore", category=UpgradeWarning): + with warnings.catch_warnings(): + warnings.filterwarnings(action="ignore", category=UpgradeWarning) uninstall_module(cr, theme)