[task] open, close from list:

This commit is contained in:
Rushabh Mehta
2015-04-01 12:13:46 +05:30
parent ee57a8d2a4
commit 918ddf2537
3 changed files with 37 additions and 18 deletions

View File

@@ -85,3 +85,12 @@ def get_project(doctype, txt, searchfield, start, page_len, filters):
limit %(start)s, %(page_len)s """ % {'key': searchfield,
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype),
'start': start, 'page_len': page_len})
@frappe.whitelist()
def set_multiple_status(names, status):
names = json.loads(names)
for name in names:
task = frappe.get_doc("Task", name)
task.status = status
task.save()

View File

@@ -1,4 +1,15 @@
frappe.listview_settings['Task'] = {
add_fields: ["project", "status", "priority", "exp_end_date"],
filters:[["status","=", "Open"]]
onload: function(listview) {
var method = "erpnext.projects.doctype.task.task.set_multiple_status";
listview.page.add_menu_item(__("Set as Open"), function() {
listview.call_for_selected_items(method, {"status": "Open"});
});
listview.page.add_menu_item(__("Set as Closed"), function() {
listview.call_for_selected_items(method, {"status": "Closed"});
});
}
};