From bf948243a6eb322652e738cc3b71d78026bd3bac Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Sun, 23 Jul 2023 19:50:14 +0530 Subject: [PATCH] refactor: refresh table once after loop ends (cherry picked from commit d048365da31d090736f5cbf768218bcca420b623) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 66cf87761d9..df3db37bc65 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -887,6 +887,8 @@ frappe.ui.form.on('Sales Invoice', { frm.events.append_time_log(frm, timesheet, 1.0); } }); + frm.refresh_field("timesheets"); + frm.trigger("calculate_timesheet_totals"); }, async get_exchange_rate(frm, from_currency, to_currency) { @@ -926,9 +928,6 @@ frappe.ui.form.on('Sales Invoice', { row.billing_amount = flt(time_log.billing_amount) * flt(exchange_rate); row.timesheet_detail = time_log.name; row.project_name = time_log.project_name; - - frm.refresh_field("timesheets"); - frm.trigger("calculate_timesheet_totals"); }, calculate_timesheet_totals: function(frm) {