mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-14 17:33:09 +00:00
[task] open, close from list:
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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"});
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user