patch for list of search criteria and reports

This commit is contained in:
Anand Doshi 2012-06-13 19:04:27 +05:30
parent 47afacc8e9
commit 94f26eae7c

View File

@ -1,18 +1,14 @@
def execute():
"""allow read permission to all for report list"""
import webnotes
import webnotes.model.doc
new_perms = [
{
'parent': 'Report',
'parentfield': 'permissions',
'parenttype': 'DocType',
'role': 'All',
'permlevel': 0,
'read': 1,
},
]
for perms in new_perms:
doc = webnotes.model.doc.Document('DocPerm')
doc.fields.update(perms)
doc.save()
webnotes.conn.sql("""\
delete from `tabDocPerm`
where parent in ('Report', 'Search Criteria')""")
webnotes.conn.commit()
import webnotes.model.sync
webnotes.model.sync.sync('core', 'search_criteria')
webnotes.model.sync.sync('core', 'report')
webnotes.conn.begin()