From 97bb6ce88b082aebc0ae94e329d2253ba6ad4fdb Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 May 2012 12:55:11 +0530 Subject: [PATCH] create report manager role patch --- erpnext/patches/may_2012/create_report_manager_role.py | 9 +++++++++ erpnext/patches/patch_list.py | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100644 erpnext/patches/may_2012/create_report_manager_role.py diff --git a/erpnext/patches/may_2012/create_report_manager_role.py b/erpnext/patches/may_2012/create_report_manager_role.py new file mode 100644 index 0000000000..6952bc0a91 --- /dev/null +++ b/erpnext/patches/may_2012/create_report_manager_role.py @@ -0,0 +1,9 @@ +def execute(): + import webnotes + from webnotes.model.doc import Document + + if not webnotes.conn.sql("select name from `tabRole` where name = 'Report Manager'"): + r = Document('Role') + r.role_name = 'Report Manager' + r.module = 'Core' + r.save() \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 32149d5d92..6155ba6a7b 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -377,4 +377,10 @@ patch_list = [ 'patch_file': 'same_purchase_rate_patch', 'description': 'Main same rate throughout pur cycle: in global defaults, by default set true' }, + { + 'patch_module': 'patches.may_2012', + 'patch_file': 'create_report_manager_role', + 'description': 'Create report manager role if not exists' + }, + ] \ No newline at end of file