Skip to content

Commit

Permalink
fix: replace document states with list settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal committed May 24, 2022
1 parent b265ca4 commit 78e9e66
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 36 deletions.
37 changes: 1 addition & 36 deletions erpnext/hr/doctype/employee_advance/employee_advance.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2022-01-17 19:33:52.345823",
"modified": "2022-05-23 19:33:52.345823",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Advance",
Expand Down Expand Up @@ -236,41 +236,6 @@
"search_fields": "employee,employee_name",
"sort_field": "modified",
"sort_order": "DESC",
"states": [
{
"color": "Red",
"custom": 1,
"title": "Draft"
},
{
"color": "Green",
"custom": 1,
"title": "Paid"
},
{
"color": "Orange",
"custom": 1,
"title": "Unpaid"
},
{
"color": "Blue",
"custom": 1,
"title": "Claimed"
},
{
"color": "Gray",
"title": "Returned"
},
{
"color": "Yellow",
"title": "Partly Claimed and Returned"
},
{
"color": "Red",
"custom": 1,
"title": "Cancelled"
}
],
"title_field": "employee_name",
"track_changes": 1
}
15 changes: 15 additions & 0 deletions erpnext/hr/doctype/employee_advance/employee_advance_list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
frappe.listview_settings["Employee Advance"] = {
get_indicator: function(doc) {
let status_color = {
"Draft": "red",
"Submitted": "blue",
"Cancelled": "red",
"Paid": "green",
"Unpaid": "orange",
"Claimed": "blue",
"Returned": "gray",
"Partly Claimed and Returned": "yellow"
};
return [__(doc.status), status_color[doc.status], "status,=,"+doc.status];
}
};

0 comments on commit 78e9e66

Please sign in to comment.