mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +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,
|
limit %(start)s, %(page_len)s """ % {'key': searchfield,
|
||||||
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype),
|
'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype),
|
||||||
'start': start, 'page_len': page_len})
|
'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'] = {
|
frappe.listview_settings['Task'] = {
|
||||||
add_fields: ["project", "status", "priority", "exp_end_date"],
|
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"});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ def execute(filters=None):
|
|||||||
{company_condition} order by posting_date""".format(company_condition=company_condition),
|
{company_condition} order by posting_date""".format(company_condition=company_condition),
|
||||||
filters, as_dict=1):
|
filters, as_dict=1):
|
||||||
|
|
||||||
key = si.posting_date[:7]
|
key = si.posting_date.strftime("%Y-%m-%d")
|
||||||
if not si.customer in customers:
|
if not si.customer in customers:
|
||||||
new_customers_in.setdefault(key, [0, 0.0])
|
new_customers_in.setdefault(key, [0, 0.0])
|
||||||
new_customers_in[key][0] += 1
|
new_customers_in[key][0] += 1
|
||||||
@@ -63,4 +63,3 @@ def execute(filters=None):
|
|||||||
], out
|
], out
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user