From 6e7a625d276e99d0718f4e49ad899ae2e878c5db Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Fri, 28 Mar 2008 13:16:36 +0000 Subject: [PATCH] bug fix check group attribute only for 'ir.actions.report.xml' 'ir.actions.report.xml' bzr revid: mga@tinyerp.com-9bf20dc74cb43011097151643a8580a15f8aaee5 --- bin/addons/base/ir/ir_values.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/addons/base/ir/ir_values.py b/bin/addons/base/ir/ir_values.py index 920e217735d..f71d48cc908 100644 --- a/bin/addons/base/ir/ir_values.py +++ b/bin/addons/base/ir/ir_values.py @@ -230,15 +230,15 @@ class ir_values(osv.osv): res = filter(bool, map(lambda x: _result_get(x, keys), list(result))) res2 = res[:] for r in res: - if type(r) == type([]) and 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() - print gr_ids - if not gr_ids[0][0] > 0: - res2.remove(r) + 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) # else: # #raise osv.except_osv('Error !','You have not permission to perform operation !!!') # res2.remove(r)