summaryrefslogtreecommitdiff
path: root/odoo/addons/base/wizard/base_module_uninstall.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-08 14:13:52 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-08 14:13:52 +0100
commit94a9fc990212667e1893104eeaa5bd95d4b2ebaa (patch)
tree333c25d17b54375ca67f22a5d11054433af4d23c /odoo/addons/base/wizard/base_module_uninstall.py
parentfe518f1feaabc0101e201b2542acf18deca9693f (diff)
parente5c8071484c883bf78478a39ef2120bcd8f2442d (diff)
[MERGE] forward port branch 11.0 up to e5c8071484c
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 60585fc7a73..d8e6846fc07 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')