diff options
| author | Raphael Collet <rco@odoo.com> | 2017-06-28 15:36:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-28 15:36:17 +0200 |
| commit | b8cf940247ce746bf2ccdd77cbcb9bfde5c026d2 (patch) | |
| tree | 4a69a88f6b68468dcab45c1a77fade9b8b29b13f /odoo/addons/base/module/module.py | |
| parent | 026f9ce0853d9e3b56ec6f162929958fbab4c903 (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 'odoo/addons/base/module/module.py')
| -rw-r--r-- | odoo/addons/base/module/module.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py index bfc018f247f..3ded39fb128 100644 --- a/odoo/addons/base/module/module.py +++ b/odoo/addons/base/module/module.py @@ -535,6 +535,18 @@ class Module(models.Model): return dict(ACTION_DICT, name=_('Uninstall')) @api.multi + def button_uninstall_wizard(self): + """ Launch the wizard to uninstall the given module. """ + return { + 'type': 'ir.actions.act_window', + 'target': 'new', + 'name': _('Uninstall module'), + 'view_mode': 'form', + 'res_model': 'base.module.uninstall', + 'context': {'default_module_id': self.id}, + } + + @api.multi def button_uninstall_cancel(self): self.write({'state': 'installed'}) return True |
