@@ -138,15 +138,13 @@ def in_extended_view_group(cr, uid, context=None):
138
138
if not extended_view :
139
139
domain .append (('complexity' , '!=' , 'expert' ))
140
140
141
- default_modules = DEFAULT_MODULES .get (module_category .name , False )
142
- if default_modules :
143
- domain .append (('name' , 'not in' , default_modules ))
144
-
145
141
modules = module_proxy .browse (cr , uid , module_proxy .search (cr , uid , domain , context = context ), context = context )
146
142
if not modules :
147
143
continue
148
144
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 )
150
148
151
149
attributes = {
152
150
'name' : 'category_%d' % (module_category .id ,),
@@ -158,8 +156,7 @@ def in_extended_view_group(cr, uid, context=None):
158
156
arch .append ("""<field %s />""" % (" " .join (["%s='%s'" % (key , value ,)
159
157
for key , value in attributes .iteritems ()]),))
160
158
161
- # Compute the module to show
162
-
159
+ # Compute the modules to show
163
160
for module_category in module_category_proxy .browse (cr , uid , module_category_ids , context = context ):
164
161
domain = [('category_id' , '=' , module_category .id )]
165
162
0 commit comments