From bee5afd85105a62604fa716384ba6201de25dae3 Mon Sep 17 00:00:00 2001 From: ljain112 Date: Mon, 30 Sep 2024 19:05:51 +0530 Subject: [PATCH] fix: override indicator color for "Draft" --- .../doctype/invoice_discounting/invoice_discounting_list.js | 1 + erpnext/accounts/doctype/payment_request/payment_request_list.js | 1 + .../accounts/doctype/pos_closing_entry/pos_closing_entry_list.js | 1 + erpnext/accounts/doctype/pos_invoice/pos_invoice_list.js | 1 + .../accounts/doctype/pos_opening_entry/pos_opening_entry_list.js | 1 + erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js | 1 + erpnext/assets/doctype/asset/asset_list.js | 1 + erpnext/manufacturing/doctype/bom_creator/bom_creator_list.js | 1 + .../doctype/production_plan/production_plan_list.js | 1 + erpnext/manufacturing/doctype/work_order/work_order_list.js | 1 + erpnext/stock/doctype/delivery_trip/delivery_trip_list.js | 1 + erpnext/stock/doctype/pick_list/pick_list_list.js | 1 + erpnext/stock/doctype/stock_entry/stock_entry_list.js | 1 + .../stock_reservation_entry/stock_reservation_entry_list.js | 1 + .../subcontracting_receipt/subcontracting_receipt_list.js | 1 + 15 files changed, 15 insertions(+) diff --git a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js index 0b08e393de23..4efc33288420 100644 --- a/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js +++ b/erpnext/accounts/doctype/invoice_discounting/invoice_discounting_list.js @@ -1,5 +1,6 @@ frappe.listview_settings["Invoice Discounting"] = { add_fields: ["status"], + has_indicator_for_draft: 1, get_indicator: function (doc) { if (doc.status == "Draft") { return [__("Draft"), "red", "status,=,Draft"]; diff --git a/erpnext/accounts/doctype/payment_request/payment_request_list.js b/erpnext/accounts/doctype/payment_request/payment_request_list.js index 6e3dcefb9788..d77003ba72fa 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request_list.js +++ b/erpnext/accounts/doctype/payment_request/payment_request_list.js @@ -1,5 +1,6 @@ frappe.listview_settings["Payment Request"] = { add_fields: ["status"], + has_indicator_for_draft: 1, get_indicator: function (doc) { if (doc.status == "Draft") { return [__("Draft"), "gray", "status,=,Draft"]; diff --git a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry_list.js b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry_list.js index 29f00fbff7b4..e6977e989985 100644 --- a/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry_list.js +++ b/erpnext/accounts/doctype/pos_closing_entry/pos_closing_entry_list.js @@ -3,6 +3,7 @@ // render frappe.listview_settings["POS Closing Entry"] = { + has_indicator_for_draft: 1, get_indicator: function (doc) { var status_color = { Draft: "red", diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice_list.js b/erpnext/accounts/doctype/pos_invoice/pos_invoice_list.js index 0379932bb7a8..5632d7260ed7 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice_list.js +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice_list.js @@ -13,6 +13,7 @@ frappe.listview_settings["POS Invoice"] = { "currency", "is_return", ], + has_indicator_for_draft: 1, get_indicator: function (doc) { var status_color = { Draft: "red", diff --git a/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry_list.js b/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry_list.js index 7ff9c4bbbc0c..2898efde437c 100644 --- a/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry_list.js +++ b/erpnext/accounts/doctype/pos_opening_entry/pos_opening_entry_list.js @@ -3,6 +3,7 @@ // render frappe.listview_settings["POS Opening Entry"] = { + has_indicator_for_draft: 1, get_indicator: function (doc) { var status_color = { Draft: "red", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js index f971f68a4546..518ea5c2d262 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js @@ -13,6 +13,7 @@ frappe.listview_settings["Sales Invoice"] = { "currency", "is_return", ], + has_indicator_for_draft: 1, get_indicator: function (doc) { const status_colors = { Draft: "grey", diff --git a/erpnext/assets/doctype/asset/asset_list.js b/erpnext/assets/doctype/asset/asset_list.js index 712958adcfc5..b094c7000461 100644 --- a/erpnext/assets/doctype/asset/asset_list.js +++ b/erpnext/assets/doctype/asset/asset_list.js @@ -1,5 +1,6 @@ frappe.listview_settings["Asset"] = { add_fields: ["status"], + has_indicator_for_draft: 1, get_indicator: function (doc) { if (doc.status === "Fully Depreciated") { return [__("Fully Depreciated"), "green", "status,=,Fully Depreciated"]; diff --git a/erpnext/manufacturing/doctype/bom_creator/bom_creator_list.js b/erpnext/manufacturing/doctype/bom_creator/bom_creator_list.js index 880994c680b9..fb39e6681a4d 100644 --- a/erpnext/manufacturing/doctype/bom_creator/bom_creator_list.js +++ b/erpnext/manufacturing/doctype/bom_creator/bom_creator_list.js @@ -1,5 +1,6 @@ frappe.listview_settings["BOM Creator"] = { add_fields: ["status"], + has_indicator_for_draft: 1, get_indicator: function (doc) { if (doc.status === "Draft") { return [__("Draft"), "red", "status,=,Draft"]; diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan_list.js b/erpnext/manufacturing/doctype/production_plan/production_plan_list.js index bfef6e1220f3..cf2863479de6 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan_list.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan_list.js @@ -1,6 +1,7 @@ frappe.listview_settings["Production Plan"] = { hide_name_column: true, add_fields: ["status"], + has_indicator_for_draft: 1, filters: [["status", "!=", "Closed"]], get_indicator: function (doc) { if (doc.status === "Submitted") { diff --git a/erpnext/manufacturing/doctype/work_order/work_order_list.js b/erpnext/manufacturing/doctype/work_order/work_order_list.js index 1e1e5661fe58..de82c5b93c74 100644 --- a/erpnext/manufacturing/doctype/work_order/work_order_list.js +++ b/erpnext/manufacturing/doctype/work_order/work_order_list.js @@ -9,6 +9,7 @@ frappe.listview_settings["Work Order"] = { "planned_start_date", "planned_end_date", ], + has_indicator_for_draft: 1, filters: [["status", "!=", "Stopped"]], get_indicator: function (doc) { if (doc.status === "Submitted") { diff --git a/erpnext/stock/doctype/delivery_trip/delivery_trip_list.js b/erpnext/stock/doctype/delivery_trip/delivery_trip_list.js index 65a1be332241..0c3dc4603a5f 100644 --- a/erpnext/stock/doctype/delivery_trip/delivery_trip_list.js +++ b/erpnext/stock/doctype/delivery_trip/delivery_trip_list.js @@ -1,5 +1,6 @@ frappe.listview_settings["Delivery Trip"] = { add_fields: ["status"], + has_indicator_for_draft: 1, get_indicator: function (doc) { if (["Cancelled", "Draft"].includes(doc.status)) { return [__(doc.status), "red", "status,=," + doc.status]; diff --git a/erpnext/stock/doctype/pick_list/pick_list_list.js b/erpnext/stock/doctype/pick_list/pick_list_list.js index 9cdbfe187205..94e73e6e7f6b 100644 --- a/erpnext/stock/doctype/pick_list/pick_list_list.js +++ b/erpnext/stock/doctype/pick_list/pick_list_list.js @@ -2,6 +2,7 @@ // For license information, please see license.txt frappe.listview_settings["Pick List"] = { + has_indicator_for_draft: 1, get_indicator: function (doc) { const status_colors = { Draft: "grey", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_list.js b/erpnext/stock/doctype/stock_entry/stock_entry_list.js index 8a1c808cd91f..62cb913a3dca 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry_list.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry_list.js @@ -7,6 +7,7 @@ frappe.listview_settings["Stock Entry"] = { "`tabStock Entry`.`bom_no`", "`tabStock Entry`.`is_return`", ], + has_indicator_for_draft: 1, get_indicator: function (doc) { if (doc.is_return === 1 && doc.purpose === "Material Transfer for Manufacture") { return [ diff --git a/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry_list.js b/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry_list.js index d2194a486c31..d6bad8033e28 100644 --- a/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry_list.js +++ b/erpnext/stock/doctype/stock_reservation_entry/stock_reservation_entry_list.js @@ -2,6 +2,7 @@ // For license information, please see license.txt frappe.listview_settings["Stock Reservation Entry"] = { + has_indicator_for_draft: 1, get_indicator: function (doc) { const status_colors = { Draft: "red", diff --git a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_list.js b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_list.js index be6c0d0b18f3..55742b5036d3 100644 --- a/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_list.js +++ b/erpnext/subcontracting/doctype/subcontracting_receipt/subcontracting_receipt_list.js @@ -2,6 +2,7 @@ // For license information, please see license.txt frappe.listview_settings["Subcontracting Receipt"] = { + has_indicator_for_draft: 1, get_indicator: function (doc) { const status_colors = { Draft: "grey",