bugfix with demo installation detection

bzr revid: christophe@tinyerp.com-20080915125200-n39c3pntsottsc9o
This commit is contained in:
Christophe Simonis 2008-09-15 14:52:00 +02:00
parent 59e46428d5
commit 7b16d23aab
1 changed files with 7 additions and 4 deletions

View File

@ -275,15 +275,16 @@ class module(osv.osv):
demo = False
for module in self.browse(cr, uid, ids):
mdemo = False
go_deeper = False
for dep in module.dependencies_id:
if dep.state == 'unknown':
raise orm.except_orm(_('Error'), _('You try to install a module that depends on the module: %s.\nBut this module is not available in your system.') % (dep.name,))
ids2 = self.search(cr, uid, [('name','=',dep.name)])
if dep.state != newstate:
go_deeper = True
ids2 = self.search(cr, uid, [('name','=',dep.name)])
mdemo = self.state_update(cr, uid, ids2, newstate, states_to_update, context, level-1,) or mdemo
if not go_deeper:
else:
od = self.browse(cr, uid, ids2)[0]
mdemo = od.demo or mdemo
if not module.dependencies_id:
mdemo = module.demo
if module.state in states_to_update:
self.write(cr, uid, [module.id], {'state': newstate, 'demo':mdemo})
@ -666,3 +667,5 @@ class module_configuration(osv.osv_memory):
return {'type':'ir.actions.act_window_close' }
module_configuration()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: