Merge branch 'shf_rename'

This commit is contained in:
Anand Doshi
2012-05-16 14:35:15 +05:30
5 changed files with 41 additions and 8 deletions

View File

@@ -49,5 +49,5 @@ class DocType:
if res:
if res[0][1]:
msgprint("POS Setting '%s' already created for user: '%s' and company: '%s'"%(res[0][0], res[0][1], self.doc.company), raise_exception=1)
else:
msgprint("Global POS Setting already created - %s for this company: '%s'" % (res[0][0], self.doc.company), raise_exception=1)
else:
msgprint("Global POS Setting already created - %s for this company: '%s'" % (res[0][0], self.doc.company), raise_exception=1)

View File

@@ -0,0 +1,30 @@
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')

View File

@@ -357,5 +357,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'
},
]