diff options
| author | Raphaël Valyi <rvalyi@gmail.com> | 2010-02-01 11:03:34 -0200 |
|---|---|---|
| committer | Raphaël Valyi <rvalyi@gmail.com> | 2010-02-01 11:03:34 -0200 |
| commit | 48e935e6a2bf4ae3f7bb333c7d25d8a6a37c20d1 (patch) | |
| tree | 90eedcd5eea138fe1934857b25c96ea5acebc31b /bin/addons/base/module/module.py | |
| parent | fe3562a57bd6b2379d4f4cdb48d72535432a2039 (diff) | |
| parent | f99cf9a615d8a4ebb2857440acecd4fac0ab9543 (diff) | |
[MERGE] from trunk
bzr revid: rvalyi@gmail.com-20100201130334-mgd708bztw2uxya9
Diffstat (limited to 'bin/addons/base/module/module.py')
| -rw-r--r-- | bin/addons/base/module/module.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index 49b6e7b6f2d..a6967773ac2 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -196,10 +196,18 @@ class module(osv.osv): return True if isinstance(ids, (int, long)): ids = [ids] - for mod in self.read(cr, uid, ids, ['state'], context): + mod_names = [] + for mod in self.read(cr, uid, ids, ['state','name'], context): if mod['state'] in ('installed', 'to upgrade', 'to remove', 'to install'): raise orm.except_orm(_('Error'), _('You try to remove a module that is installed or will be installed')) + mod_names.append(mod['name']) + #Removing the entry from ir_model_data + ids_meta = self.pool.get('ir.model.data').search(cr, uid, [('name', '=', 'module_meta_information'), ('module', 'in', mod_names)]) + + if ids_meta: + self.pool.get('ir.model.data').unlink(cr, uid, ids_meta, context) + return super(module, self).unlink(cr, uid, ids, context=context) def state_update(self, cr, uid, ids, newstate, states_to_update, context={}, level=100): |
