patch for list of search criteria and reports
This commit is contained in:
parent
47afacc8e9
commit
94f26eae7c
@ -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()
|
Loading…
Reference in New Issue
Block a user