From 2fe00281cfd4741f888e73f830697d0f9ad1d3fc Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Fri, 18 Oct 2013 11:46:18 +0530 Subject: [PATCH] [feature] include single type doctypes in permission manager --- core/page/permission_manager/permission_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/page/permission_manager/permission_manager.py b/core/page/permission_manager/permission_manager.py index f9b1d43ce7..b43c5db96f 100644 --- a/core/page/permission_manager/permission_manager.py +++ b/core/page/permission_manager/permission_manager.py @@ -8,10 +8,10 @@ import webnotes.defaults @webnotes.whitelist(allow_roles=["System Manager", "Administrator"]) def get_roles_and_doctypes(): return { - "doctypes": [d[0] for d in webnotes.conn.sql("""select name from tabDocType where + "doctypes": [d[0] for d in webnotes.conn.sql("""select name from `tabDocType` dt where ifnull(istable,0)=0 and - ifnull(issingle,0)=0 and - name not in ('DocType')""")], + name not in ('DocType', 'Control Panel') and + exists(select * from `tabDocField` where parent=dt.name)""")], "roles": [d[0] for d in webnotes.conn.sql("""select name from tabRole where name not in ('Guest', 'Administrator')""")] }