File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ def test_access_rules(self):
164164 """Test access rules for all the models created in the module
165165 """
166166 logger .info ('Testing access rules for module %s' , self .config ['module' ])
167+ model_obj = self .openerp .pool .get ('ir.model' )
167168 imd_obj = self .openerp .pool .get ('ir.model.data' )
168169 access_obj = self .openerp .pool .get ('ir.model.access' )
169170 no_access = []
@@ -181,7 +182,8 @@ def test_access_rules(self):
181182 if imd_ids :
182183 for imd in imd_obj .browse (txn .cursor , txn .user , imd_ids ):
183184 model_id = imd .res_id
184- if getattr (self .openerp .pool .get (imd .model ), '_test_class' , False ):
185+ pool_model = model_obj .read (txn .cursor , txn .user , model_id , ['model' ])['model' ]
186+ if getattr (self .openerp .pool .get (pool_model ), '_test_class' , False ):
185187 continue
186188 access_ids = access_obj .search (cursor , uid , [
187189 ('model_id.id' , '=' , model_id )
You can’t perform that action at this time.
0 commit comments