Skip to content

Commit

Permalink
fix(Leave Application): misleading draft state indicator (#1085) (#1088)
Browse files Browse the repository at this point in the history
* fix: misleading drafted state indicator

* fix: standard draft indicator color

---------

Co-authored-by: Rucha Mahabal <[email protected]>
(cherry picked from commit 79d5504)

Co-authored-by: Akash  Tom <[email protected]>
  • Loading branch information
mergify[bot] and krantheman authored Nov 21, 2023
1 parent ec5c6ee commit 72406ae
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions hrms/hr/doctype/leave_application/leave_application_list.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
frappe.listview_settings["Leave Application"] = {
add_fields: ["leave_type", "employee", "employee_name", "total_leave_days", "from_date", "to_date"],
add_fields: [
"leave_type",
"employee",
"employee_name",
"total_leave_days",
"from_date",
"to_date",
],
has_indicator_for_draft: 1,
get_indicator: function (doc) {
let status_color = {
"Approved": "green",
"Rejected": "red",
"Open": "orange",
"Cancelled": "red",
"Submitted": "blue"
const status_color = {
Approved: "green",
Rejected: "red",
Open: "orange",
Draft: "red",
Cancelled: "red",
Submitted: "blue",
};
return [__(doc.status), status_color[doc.status], "status,=," + doc.status];
}
const status =
!doc.docstatus && ["Approved", "Rejected"].includes(doc.status)
? "Draft"
: doc.status;
return [__(status), status_color[status], "status,=," + doc.status];
},
};

0 comments on commit 72406ae

Please sign in to comment.