1. Reports List - allow read permission to All
2. Display message when ToDo doesnt contain any item
diff --git a/erpnext/patches/june_2012/reports_list_permission.py b/erpnext/patches/june_2012/reports_list_permission.py
new file mode 100644
index 0000000..2f47bf1
--- /dev/null
+++ b/erpnext/patches/june_2012/reports_list_permission.py
@@ -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()
\ No newline at end of file
diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py
index 7404b55..b471780 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -427,4 +427,9 @@
'patch_file': 'fetch_organization_from_lead',
'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'
+ },
]
\ No newline at end of file
diff --git a/erpnext/utilities/page/todo/todo.js b/erpnext/utilities/page/todo/todo.js
index 01065a7..8cd8fc1 100644
--- a/erpnext/utilities/page/todo/todo.js
+++ b/erpnext/utilities/page/todo/todo.js
@@ -20,14 +20,31 @@
wn.call({
method: 'utilities.page.todo.todo.get',
callback: function(r,rt) {
- $('#todo-list div.todo-content').empty();
- $('#assigned-todo-list div.todo-content').empty();
+ var todo_list = $('#todo-list div.todo-content');
+ 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) {
for(var i in r.message) {
new erpnext.todo.ToDoItem(r.message[i]);
}
+ if (!todo_list.html()) { nothing_to_do(); }
+ if (!assigned_todo_list.html()) { nothing_delegated(); }
} else {
- $('#todo-list').html('<div class="help-box">Nothing to do :)</div>');
+ nothing_to_do();
+ nothing_delegated();
}
}
});