summaryrefslogtreecommitdiff
path: root/bin/addons/base/module/module.py
diff options
context:
space:
mode:
authorHDA (OpenERP) <hda@tinyerp.com>2010-01-12 16:18:30 +0530
committerHDA (OpenERP) <hda@tinyerp.com>2010-01-12 16:18:30 +0530
commit8a887ad4e09dfc9ae35204f0c31a15aeda0fb301 (patch)
treefe322bd35b9e3aef61751dff095e24227aa31e49 /bin/addons/base/module/module.py
parent7314cc0c9bbccb251ea85689068e11d75a553b57 (diff)
parent78574879c3f924b5e2314cd03afdbcc0da6cbe67 (diff)
Merged
bzr revid: hda@tinyerp.com-20100112104830-x35l4g08og2gacwo
Diffstat (limited to 'bin/addons/base/module/module.py')
-rw-r--r--bin/addons/base/module/module.py10
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):