summaryrefslogtreecommitdiff
path: root/odoo/addons/base/wizard/base_module_uninstall.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-09 14:51:55 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-09 14:51:55 +0100
commit3e4b9d4d66c18cb620a3b6a8be76018d4ce177ec (patch)
treeb10db9f40733d6673f8b450e4e9bd9beebf44bac /odoo/addons/base/wizard/base_module_uninstall.py
parent9e8c63e1ec09f92f8a946c5b14dbcea9dab7c447 (diff)
parent639bd896353648ea433dfc3954fc1bce3e14aea9 (diff)
[MERGE] forward port branch saas-11.4 up to 639bd896353
Diffstat (limited to 'odoo/addons/base/wizard/base_module_uninstall.py')
-rw-r--r--odoo/addons/base/wizard/base_module_uninstall.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/odoo/addons/base/wizard/base_module_uninstall.py b/odoo/addons/base/wizard/base_module_uninstall.py
index ac224dcc82b..a3f53f38c31 100644
--- a/odoo/addons/base/wizard/base_module_uninstall.py
+++ b/odoo/addons/base/wizard/base_module_uninstall.py
@@ -40,10 +40,12 @@ class BaseModuleUninstall(models.TransientModel):
for wizard in self:
if wizard.module_id:
module_names = set(wizard._get_modules().mapped('name'))
- # find the models that have all their XIDs in the given modules
+
def lost(model):
- return all(xid.split('.')[0] in module_names
- for xid in ir_models_xids.get(model.id, ()))
+ xids = ir_models_xids.get(model.id, ())
+ return xids and all(xid.split('.')[0] in module_names for xid in xids)
+
+ # find the models that have all their XIDs in the given modules
self.model_ids = ir_models.filtered(lost).sorted('name')
@api.onchange('module_id')