fix: replace document states with list settings

This commit is contained in:
Rucha Mahabal
2022-05-23 19:49:05 +05:30
parent b265ca467c
commit 78e9e66d63
2 changed files with 16 additions and 36 deletions

View File

@@ -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",
@@ -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
}

View File

@@ -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];
}
};