summaryrefslogtreecommitdiff
path: root/addons/mail/wizard
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
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')
-rw-r--r--addons/mail/wizard/__init__.py1
-rw-r--r--addons/mail/wizard/base_module_uninstall.py13
2 files changed, 14 insertions, 0 deletions
diff --git a/addons/mail/wizard/__init__.py b/addons/mail/wizard/__init__.py
index 2181ffa8266..2523a3593b0 100644
--- a/addons/mail/wizard/__init__.py
+++ b/addons/mail/wizard/__init__.py
@@ -4,3 +4,4 @@
from . import invite
from . import mail_compose_message
from . import email_template_preview
+from . import base_module_uninstall
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')