From 1d2710d54d9c391f784df1ded8691feb878dc738 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 10 Jan 2013 17:11:48 +0530 Subject: [PATCH] added 'report' permission --- patches/january_2013/report_permission.py | 10 ++++++++++ patches/patch_list.py | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 patches/january_2013/report_permission.py diff --git a/patches/january_2013/report_permission.py b/patches/january_2013/report_permission.py new file mode 100644 index 00000000000..5e69229e69d --- /dev/null +++ b/patches/january_2013/report_permission.py @@ -0,0 +1,10 @@ +import webnotes +def execute(): + webnotes.reload_doc("core", "doctype", "docperm") + webnotes.conn.sql("""update tabDocPerm set `report`=`write`""") + webnotes.conn.sql("""update tabDocPerm, tabDocType set tabDocPerm.`report`=0 + where tabDocPerm.`parent` = tabDocType.name + and ifnull(tabDocType.issingle,0) = 1""") + webnotes.conn.sql("""update tabDocPerm, tabDocType set tabDocPerm.`submit`=0 + where tabDocPerm.`parent` = tabDocType.name + and ifnull(tabDocType.is_submittable,0) = 0""") \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index f9bb97cf8ad..52e1b028b62 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -582,4 +582,8 @@ patch_list = [ 'patch_module': 'patches.january_2013', 'patch_file': 'holiday_list_patch', }, + { + 'patch_module': 'patches.january_2013', + 'patch_file': 'report_permission', + }, ] \ No newline at end of file