From 28335b7ee7fac907b4075c39cea9e686a278454d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 16 May 2012 13:44:06 +0530 Subject: [PATCH] print format readonly patch --- erpnext/patches/may_2012/std_pf_readonly.py | 24 +++++++++++++++++++++ erpnext/patches/patch_list.py | 5 +++++ 2 files changed, 29 insertions(+) create mode 100644 erpnext/patches/may_2012/std_pf_readonly.py diff --git a/erpnext/patches/may_2012/std_pf_readonly.py b/erpnext/patches/may_2012/std_pf_readonly.py new file mode 100644 index 0000000000..abee9e2ce9 --- /dev/null +++ b/erpnext/patches/may_2012/std_pf_readonly.py @@ -0,0 +1,24 @@ +def execute(): + """Make standard print formats readonly for system manager""" + import webnotes.model.doc + new_perms = [ + { + 'parent': 'Print Format', + 'parentfield': 'permissions', + 'parenttype': 'DocType', + 'role': 'System Manager', + 'permlevel': 1, + 'read': 1, + }, + { + 'parent': 'Print Format', + 'parentfield': 'permissions', + 'parenttype': 'DocType', + 'role': 'Administrator', + 'permlevel': 1, + 'read': 1, + 'write': 1 + }, + ] + import webnotes.model.sync + webnotes.model.sync.sync('core', 'print_format') \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 5a82d425a2..e3eca5ac54 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -352,5 +352,10 @@ patch_list = [ 'patch_file': 'reload_sales_invoice_pf', 'description': 'Reload sales invoice print formats' }, + { + 'patch_module': 'patches.may_2012', + 'patch_file': 'std_pf_readonly', + 'description': 'Make standard print formats readonly for system manager' + }, ]