patch for list of search criteria and reports
This commit is contained in:
parent
47afacc8e9
commit
94f26eae7c
@ -1,18 +1,14 @@
|
|||||||
def execute():
|
def execute():
|
||||||
"""allow read permission to all for report list"""
|
"""allow read permission to all for report list"""
|
||||||
import webnotes
|
import webnotes
|
||||||
import webnotes.model.doc
|
webnotes.conn.sql("""\
|
||||||
new_perms = [
|
delete from `tabDocPerm`
|
||||||
{
|
where parent in ('Report', 'Search Criteria')""")
|
||||||
'parent': 'Report',
|
|
||||||
'parentfield': 'permissions',
|
webnotes.conn.commit()
|
||||||
'parenttype': 'DocType',
|
|
||||||
'role': 'All',
|
import webnotes.model.sync
|
||||||
'permlevel': 0,
|
webnotes.model.sync.sync('core', 'search_criteria')
|
||||||
'read': 1,
|
webnotes.model.sync.sync('core', 'report')
|
||||||
},
|
|
||||||
]
|
webnotes.conn.begin()
|
||||||
for perms in new_perms:
|
|
||||||
doc = webnotes.model.doc.Document('DocPerm')
|
|
||||||
doc.fields.update(perms)
|
|
||||||
doc.save()
|
|
Loading…
x
Reference in New Issue
Block a user