From 8f6ba93598f444ffc261d061425af3de55cfc82a Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhoda Date: Thu, 5 Dec 2024 10:59:28 +0530 Subject: [PATCH 1/2] refactor: Update `e-Waybill Log` list view (cherry picked from commit 69b556c82dc3b7452573c2238e7171e40910c192) --- .../doctype/e_waybill_log/e_waybill_log.js | 4 +-- .../doctype/e_waybill_log/e_waybill_log.json | 3 ++- .../e_waybill_log/e_waybill_log_list.js | 26 +++++++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log_list.js diff --git a/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log.js b/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log.js index 6752e48320..79f4086f8f 100644 --- a/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log.js +++ b/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log.js @@ -1,8 +1,8 @@ // Copyright (c) 2022, Resilient Tech and contributors // For license information, please see license.txt -frappe.ui.form.on('e-Waybill Log', { +// frappe.ui.form.on('e-Waybill Log', { // refresh: function(frm) { // } -}); +// }); diff --git a/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log.json b/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log.json index ee19ed22ee..a805ea1ebe 100644 --- a/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log.json +++ b/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log.json @@ -99,6 +99,7 @@ { "fieldname": "reference_doctype", "fieldtype": "Link", + "in_list_view": 1, "in_standard_filter": 1, "label": "Reference Document Type", "options": "DocType", @@ -181,7 +182,7 @@ "link_fieldname": "ewaybill" } ], - "modified": "2024-07-17 12:26:38.069883", + "modified": "2024-12-05 09:50:37.014667", "modified_by": "Administrator", "module": "GST India", "name": "e-Waybill Log", diff --git a/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log_list.js b/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log_list.js new file mode 100644 index 0000000000..34d344b1fd --- /dev/null +++ b/india_compliance/gst_india/doctype/e_waybill_log/e_waybill_log_list.js @@ -0,0 +1,26 @@ +// Copyright (c) 2024, Resilient Tech and contributors +// For license information, please see license.txt + +frappe.listview_settings["e-Waybill Log"] = { + hide_name_column: true, + + button: { + show: function (doc) { + return doc.reference_name; + }, + + get_label: function () { + return __("Open Reference"); + }, + + get_description: function (doc) { + return __("Open {0}", [ + `${__(doc.reference_doctype)}: ${doc.reference_name}`, + ]); + }, + + action: function (doc) { + frappe.set_route("Form", doc.reference_doctype, doc.reference_name); + }, + }, +}; From f54a92ff828848468d10aeb810f3bcf6d31ada0c Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhoda Date: Thu, 5 Dec 2024 11:07:25 +0530 Subject: [PATCH 2/2] refactor: Update `e-Invoice Log` list view (cherry picked from commit ba431347a978596284843ca6ad78b1a390ac41e8) --- .../doctype/e_invoice_log/e_invoice_log.js | 8 +++--- .../e_invoice_log/e_invoice_log_list.js | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log_list.js diff --git a/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log.js b/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log.js index 0c181cb0b3..f9cf744010 100644 --- a/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log.js +++ b/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log.js @@ -1,8 +1,8 @@ // Copyright (c) 2022, Resilient Tech and contributors // For license information, please see license.txt -frappe.ui.form.on('e-Invoice Log', { - // refresh: function(frm) { +// frappe.ui.form.on('e-Invoice Log', { +// refresh: function(frm) { - // } -}); +// } +// }); diff --git a/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log_list.js b/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log_list.js new file mode 100644 index 0000000000..fc4cf9e480 --- /dev/null +++ b/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log_list.js @@ -0,0 +1,26 @@ +// Copyright (c) 2024, Resilient Tech and contributors +// For license information, please see license.txt + +frappe.listview_settings["e-Invoice Log"] = { + hide_name_column: true, + + button: { + show: function (doc) { + return doc.reference_name; + }, + + get_label: function () { + return __("Open Reference"); + }, + + get_description: function (doc) { + return __("Open {0}", [ + `${__(doc.reference_doctype)}: ${doc.reference_name}`, + ]); + }, + + action: function (doc) { + frappe.set_route("Form", doc.reference_doctype, doc.reference_name); + }, + }, +};