mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-12 17:51:20 +00:00
moved directory structure
This commit is contained in:
31
patches/may_2012/std_pf_readonly.py
Normal file
31
patches/may_2012/std_pf_readonly.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from __future__ import unicode_literals
|
||||
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
|
||||
},
|
||||
]
|
||||
for perms in new_perms:
|
||||
doc = webnotes.model.doc.Document('DocPerm')
|
||||
doc.fields.update(perms)
|
||||
doc.save()
|
||||
webnotes.conn.commit()
|
||||
webnotes.conn.begin()
|
||||
import webnotes.model.sync
|
||||
webnotes.model.sync.sync('core', 'print_format')
|
||||
Reference in New Issue
Block a user