diff options
Diffstat (limited to 'odoo/addons/base/wizard/base_module_uninstall.py')
| -rw-r--r-- | odoo/addons/base/wizard/base_module_uninstall.py | 8 |
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') |
