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 00000000000..6952bc0a918 --- /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 34e384c203a..b38bcaadf6d 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -387,5 +387,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