[FIX] base_setup: Fix a problem with categories to show

bzr revid: stw@openerp.com-20111006120338-9zetw1glf0rdxo27
This commit is contained in:
Stephane Wirtel 2011-10-06 14:03:38 +02:00
parent 9990d8126e
commit 253467dfe2
1 changed files with 4 additions and 7 deletions

View File

@ -138,15 +138,13 @@ class base_setup_installer(osv.osv_memory):
if not extended_view:
domain.append(('complexity', '!=', 'expert'))
default_modules = DEFAULT_MODULES.get(module_category.name, False)
if default_modules:
domain.append(('name', 'not in', default_modules))
modules = module_proxy.browse(cr, uid, module_proxy.search(cr, uid, domain, context=context), context=context)
if not modules:
continue
readonly = any(module.state == 'installed' for module in modules)
m = DEFAULT_MODULES.get(module_category.name, [])
r = module_proxy.search(cr, uid, [('state', '=', 'installed'),('name', 'in', m)], context=context)
readonly = bool(r)
attributes = {
'name' : 'category_%d' % (module_category.id,),
@ -158,8 +156,7 @@ class base_setup_installer(osv.osv_memory):
arch.append("""<field %s />""" % (" ".join(["%s='%s'" % (key, value,)
for key, value in attributes.iteritems()]),))
# Compute the module to show
# Compute the modules to show
for module_category in module_category_proxy.browse(cr, uid, module_category_ids, context=context):
domain = [('category_id', '=', module_category.id)]