summaryrefslogtreecommitdiff
path: root/bin/addons/base/module/wizard/wizard_module_upgrade.py
diff options
context:
space:
mode:
authorHarshad Modi <hmo@tinyerp.com>2008-08-19 18:16:16 +0530
committerHarshad Modi <hmo@tinyerp.com>2008-08-19 18:16:16 +0530
commit84c2b58ea3d5283b3bfafc7e9147b0440641d88f (patch)
treeb482fb0e9d670ae54e99dd68e2ee98adc88a60c0 /bin/addons/base/module/wizard/wizard_module_upgrade.py
parent8da94d89f86b807edf7079601860b1328294ba02 (diff)
fixed bugs on installing module:\n *raising an error when a module to be installed is unknown or uninstalled of the system and telling which module is missing.
bzr revid: hmo@tinyerp.com-20080819124616-35yndpzazw3gvo98
Diffstat (limited to 'bin/addons/base/module/wizard/wizard_module_upgrade.py')
-rw-r--r--bin/addons/base/module/wizard/wizard_module_upgrade.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/addons/base/module/wizard/wizard_module_upgrade.py b/bin/addons/base/module/wizard/wizard_module_upgrade.py
index c9cf6042108..55432bd44f9 100644
--- a/bin/addons/base/module/wizard/wizard_module_upgrade.py
+++ b/bin/addons/base/module/wizard/wizard_module_upgrade.py
@@ -89,6 +89,15 @@ class wizard_info_get(wizard.interface):
mod_obj = pool.get('ir.module.module')
ids = mod_obj.search(cr, uid, [
('state', 'in', ['to upgrade', 'to remove', 'to install'])])
+ unmet_packages=[]
+ mod_dep_obj = pool.get('ir.module.module.dependency')
+ for mod in mod_obj.browse(cr,uid,ids):
+ depends_mod_ids=mod_dep_obj.search(cr,uid,[('module_id','=',mod.id)])
+ for dep_mod in mod_dep_obj.browse(cr,uid,depends_mod_ids):
+ if dep_mod.state in ('unknown','uninstalled'):
+ unmet_packages.append(dep_mod.name)
+ if len(unmet_packages):
+ raise wizard.except_wizard('Unmet dependency !','Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages))
mod_obj.download(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)