From 80eb8754dbcfdc27b9ccc03c1a5581df161a2e66 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 13 Jul 2023 15:04:44 +0530 Subject: [PATCH] fix: incorrect `idx` on JE's after reconciliation (cherry picked from commit 72f577aad2dee7f691b58cded992a5d86d5efe02) --- erpnext/accounts/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index aa861a48eff3..5662e99c5e70 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -570,7 +570,11 @@ def update_reference_in_journal_entry(d, journal_entry, do_not_save=False): # new row with references new_row = journal_entry.append("accounts") - new_row.update((frappe.copy_doc(jv_detail)).as_dict()) + # Copy field values into new row + [ + new_row.set(field, jv_detail.get(field)) + for field in frappe.get_meta("Journal Entry Account").get_fieldnames_with_value() + ] new_row.set(d["dr_or_cr"], d["allocated_amount"]) new_row.set(