From 275844d49654688b2323bd6b5273f13546a154a6 Mon Sep 17 00:00:00 2001 From: Jatin3128 <140256508+Jatin3128@users.noreply.github.com> Date: Fri, 21 Aug 2026 01:57:04 +0530 Subject: [PATCH] fix(journal-entry): avoid full grid re-render per row in set_exchange_rate (#58328) refresh() loops over every row in the accounts child table and calls set_exchange_rate() for each one. That function unconditionally ended with frm.refresh_field("accounts"), rebuilding the whole grid (header, pagination, current page) on every single row. For large child tables this makes opening the form scale badly with row count. Use grid.refresh_row(cdn) instead, which only re-renders the row that actually changed and is a no-op for rows outside the current page. Measured on a 1000-row Journal Entry: ~8.5s to first rendered row and ~7.9s of blocked main thread before this fix, ~2.3s and ~1.9s after. --- erpnext/accounts/doctype/journal_entry/journal_entry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index cf69f1bab4d..02176131cca 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -677,6 +677,6 @@ Object.assign(erpnext.journal_entry, { } else { erpnext.journal_entry.set_debit_credit_in_company_currency(frm, cdt, cdn); } - frm.refresh_field("accounts"); + frm.get_field("accounts").grid.refresh_row(cdn); }, });