Skip to content

Commit 253467d

Browse files
author
Stephane Wirtel
committed
[FIX] base_setup: Fix a problem with categories to show
bzr revid: [email protected]
1 parent 9990d81 commit 253467d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

addons/base_setup/base_setup.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,13 @@ def in_extended_view_group(cr, uid, context=None):
138138
if not extended_view:
139139
domain.append(('complexity', '!=', 'expert'))
140140

141-
default_modules = DEFAULT_MODULES.get(module_category.name, False)
142-
if default_modules:
143-
domain.append(('name', 'not in', default_modules))
144-
145141
modules = module_proxy.browse(cr, uid, module_proxy.search(cr, uid, domain, context=context), context=context)
146142
if not modules:
147143
continue
148144

149-
readonly = any(module.state == 'installed' for module in modules)
145+
m = DEFAULT_MODULES.get(module_category.name, [])
146+
r = module_proxy.search(cr, uid, [('state', '=', 'installed'),('name', 'in', m)], context=context)
147+
readonly = bool(r)
150148

151149
attributes = {
152150
'name' : 'category_%d' % (module_category.id,),
@@ -158,8 +156,7 @@ def in_extended_view_group(cr, uid, context=None):
158156
arch.append("""<field %s />""" % (" ".join(["%s='%s'" % (key, value,)
159157
for key, value in attributes.iteritems()]),))
160158

161-
# Compute the module to show
162-
159+
# Compute the modules to show
163160
for module_category in module_category_proxy.browse(cr, uid, module_category_ids, context=context):
164161
domain = [('category_id', '=', module_category.id)]
165162

0 commit comments

Comments
 (0)