1. Reports List - allow read permission to All
2. Display message when ToDo doesnt contain any item
This commit is contained in:
parent
d104f4bc32
commit
47afacc8e9
18
erpnext/patches/june_2012/reports_list_permission.py
Normal file
18
erpnext/patches/june_2012/reports_list_permission.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
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()
|
@ -427,4 +427,9 @@ patch_list = [
|
|||||||
'patch_file': 'fetch_organization_from_lead',
|
'patch_file': 'fetch_organization_from_lead',
|
||||||
'description': 'Fetch organization from lead in quote'
|
'description': 'Fetch organization from lead in quote'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'patch_module': 'patches.june_2012',
|
||||||
|
'patch_file': 'reports_list_permission',
|
||||||
|
'description': 'allow read permission to all for report list'
|
||||||
|
},
|
||||||
]
|
]
|
@ -20,14 +20,31 @@ erpnext.todo.refresh = function() {
|
|||||||
wn.call({
|
wn.call({
|
||||||
method: 'utilities.page.todo.todo.get',
|
method: 'utilities.page.todo.todo.get',
|
||||||
callback: function(r,rt) {
|
callback: function(r,rt) {
|
||||||
$('#todo-list div.todo-content').empty();
|
var todo_list = $('#todo-list div.todo-content');
|
||||||
$('#assigned-todo-list div.todo-content').empty();
|
var assigned_todo_list = $('#assigned-todo-list div.todo-content');
|
||||||
|
todo_list.empty();
|
||||||
|
assigned_todo_list.empty();
|
||||||
|
|
||||||
|
var nothing_to_do = function() {
|
||||||
|
$('#todo-list div.todo-content')
|
||||||
|
.html('<div class="help-box">Nothing to do :)</div>');
|
||||||
|
}
|
||||||
|
|
||||||
|
var nothing_delegated = function() {
|
||||||
|
$('#assigned-todo-list div.todo-content')
|
||||||
|
.html('<div class="help-box">Nothing assigned to other users. \
|
||||||
|
Use "Assign To" in a form to delegate work.</div>');
|
||||||
|
}
|
||||||
|
|
||||||
if(r.message) {
|
if(r.message) {
|
||||||
for(var i in r.message) {
|
for(var i in r.message) {
|
||||||
new erpnext.todo.ToDoItem(r.message[i]);
|
new erpnext.todo.ToDoItem(r.message[i]);
|
||||||
}
|
}
|
||||||
|
if (!todo_list.html()) { nothing_to_do(); }
|
||||||
|
if (!assigned_todo_list.html()) { nothing_delegated(); }
|
||||||
} else {
|
} else {
|
||||||
$('#todo-list').html('<div class="help-box">Nothing to do :)</div>');
|
nothing_to_do();
|
||||||
|
nothing_delegated();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user