Skip to content

Commit

Permalink
fix: Document Name link validation in Bank Reconciliation Tool (#36495)
Browse files Browse the repository at this point in the history
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 7ab55b1)

# Conflicts:
#	erpnext/public/js/bank_reconciliation_tool/dialog_manager.js
  • Loading branch information
batonac authored and mergify[bot] committed Aug 14, 2023
1 parent 716d5c0 commit 83cbc1b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions erpnext/public/js/bank_reconciliation_tool/dialog_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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 = {
Expand Down

0 comments on commit 83cbc1b

Please sign in to comment.