fix(Leave Application): 'Cancelled' status shown as 'Open' in list view

This commit is contained in:
Rucha Mahabal 2022-06-03 17:00:01 +05:30
parent 59de303b13
commit cf04683ad3

View File

@ -1,13 +1,14 @@
frappe.listview_settings['Leave Application'] = {
frappe.listview_settings["Leave Application"] = {
add_fields: ["leave_type", "employee", "employee_name", "total_leave_days", "from_date", "to_date"],
has_indicator_for_draft: 1,
get_indicator: function (doc) {
if (doc.status === "Approved") {
return [__("Approved"), "green", "status,=,Approved"];
} else if (doc.status === "Rejected") {
return [__("Rejected"), "red", "status,=,Rejected"];
} else {
return [__("Open"), "red", "status,=,Open"];
}
let status_color = {
"Approved": "green",
"Rejected": "red",
"Open": "orange",
"Cancelled": "red",
"Submitted": "blue"
};
return [__(doc.status), status_color[doc.status], "status,=," + doc.status];
}
};