block code for few time

bzr revid: mga@tinyerp.com-fd43514f989e3883e98554946cd3979d4bcfbe7e
This commit is contained in:
Mantavya Gajjar 2008-03-28 13:30:21 +00:00
parent 6e7a625d27
commit 6a88a9fa40
1 changed files with 11 additions and 10 deletions

View File

@ -229,16 +229,17 @@ class ir_values(osv.osv):
keys = []
res = filter(bool, map(lambda x: _result_get(x, keys), list(result)))
res2 = res[:]
for r in res:
if r[2]['type'] == 'ir.actions.report.xml' or r[2]['type'] == 'ir.actions.report.xml':
if r[2].has_key('groups_id'):
groups = r[2]['groups_id']
if len(groups) > 0:
group_ids = ','.join([ str(x) for x in r[2]['groups_id']])
cr.execute("select count(*) from res_groups_users_rel where gid in (%s) and uid='%s'" % (group_ids, uid))
gr_ids = cr.fetchall()
if not gr_ids[0][0] > 0:
res2.remove(r)
# for r in res:
# if r[2]['type'] == 'ir.actions.report.xml' or r[2]['type'] == 'ir.actions.report.xml':
# print
# if r[2].has_key('groups_id'):
# groups = r[2]['groups_id']
# if len(groups) > 0:
# group_ids = ','.join([ str(x) for x in r[2]['groups_id']])
# cr.execute("select count(*) from res_groups_users_rel where gid in (%s) and uid='%s'" % (group_ids, uid))
# gr_ids = cr.fetchall()
# if not gr_ids[0][0] > 0:
# res2.remove(r)
# else:
# #raise osv.except_osv('Error !','You have not permission to perform operation !!!')
# res2.remove(r)