From 83cbc1bef6fb8b9302c7d6ba747d648296edd8a3 Mon Sep 17 00:00:00 2001 From: Kevin Shenk Date: Mon, 14 Aug 2023 09:33:01 -0400 Subject: [PATCH 1/2] fix: Document Name link validation in Bank Reconciliation Tool (#36495) fix: format_row broke Document Name link validation #35540 broke Voucher Matching, leading to an invalid link exception on submission. This is because the format_row() function overwrites the row data instead of just providing a formatter on the DataTable column, and therefore passes through the formatted (linked) column data instead of the Document Name only. This patch moves the appropriate frappe.form.formatters.Link function to a dedicated format hook on the DataTable columns definition, both fixing the error and retaining the functionality of #35540. (cherry picked from commit 7ab55b1bb293517aaac11193f25efdf6ccbc7bb4) # Conflicts: # erpnext/public/js/bank_reconciliation_tool/dialog_manager.js --- .../bank_reconciliation_tool/dialog_manager.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js b/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js index 1271e38049a..4e2de8b0ff8 100644 --- a/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js +++ b/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js @@ -117,6 +117,9 @@ erpnext.accounts.bank_reconciliation.DialogManager = class DialogManager { name: __("Document Name"), editable: false, width: 1, + format: (value, row) => { + return frappe.form.formatters.Link(value, {options: row[2].content}); + }, }, { name: __("Reference Date"), @@ -141,6 +144,20 @@ erpnext.accounts.bank_reconciliation.DialogManager = class DialogManager { ]; } +<<<<<<< HEAD +======= + format_row(row) { + return [ + row[1], // Document Type + row[2], // Document Name + row[5] || row[8], // Reference Date + format_currency(row[3], row[9]), // Remaining + row[4], // Reference Number + row[6], // Party + ]; + } + +>>>>>>> 7ab55b1bb2 (fix: Document Name link validation in Bank Reconciliation Tool (#36495)) get_datatable(proposals_wrapper) { if (!this.datatable) { const datatable_options = { From ee5a1d91ff2961919ad996e9e5b9f2ec152426e0 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 17 Aug 2023 20:45:53 +0530 Subject: [PATCH 2/2] chore: resolve conflicts --- .../js/bank_reconciliation_tool/dialog_manager.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js b/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js index 4e2de8b0ff8..ddc10530581 100644 --- a/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js +++ b/erpnext/public/js/bank_reconciliation_tool/dialog_manager.js @@ -144,20 +144,6 @@ erpnext.accounts.bank_reconciliation.DialogManager = class DialogManager { ]; } -<<<<<<< HEAD -======= - format_row(row) { - return [ - row[1], // Document Type - row[2], // Document Name - row[5] || row[8], // Reference Date - format_currency(row[3], row[9]), // Remaining - row[4], // Reference Number - row[6], // Party - ]; - } - ->>>>>>> 7ab55b1bb2 (fix: Document Name link validation in Bank Reconciliation Tool (#36495)) get_datatable(proposals_wrapper) { if (!this.datatable) { const datatable_options = {