summaryrefslogtreecommitdiff
path: root/addons/mail/wizard/base_module_uninstall.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2017-06-28 15:36:17 +0200
committerGitHub <noreply@github.com>2017-06-28 15:36:17 +0200
commitb8cf940247ce746bf2ccdd77cbcb9bfde5c026d2 (patch)
tree4a69a88f6b68468dcab45c1a77fade9b8b29b13f /addons/mail/wizard/base_module_uninstall.py
parent026f9ce0853d9e3b56ec6f162929958fbab4c903 (diff)
[ADD] base: new wizard to uninstall a module (#17284)
The "Uninstall" button on the module form no longer changes the state of modules, so that cancelling the wizard will not unexpectedly perform the uninstallation. The uninstallation is performed only by clicking on the "Confirm" button on the wizard. Moreover, the wizard provides clearer information about the impact of the uninstallation: what apps/modules will be uninstalled and what documents (models) will be lost.
Diffstat (limited to 'addons/mail/wizard/base_module_uninstall.py')
-rw-r--r--addons/mail/wizard/base_module_uninstall.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/mail/wizard/base_module_uninstall.py b/addons/mail/wizard/base_module_uninstall.py
new file mode 100644
index 00000000000..43e029ba851
--- /dev/null
+++ b/addons/mail/wizard/base_module_uninstall.py
@@ -0,0 +1,13 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import models
+
+
+class BaseModuleUninstall(models.TransientModel):
+ _inherit = "base.module.uninstall"
+
+ def _get_models(self):
+ # consider mail-thread models only
+ models = super(BaseModuleUninstall, self)._get_models()
+ return models.filtered('is_mail_thread')