From 4573cd15a9f2a529bc39f2cd1099b7d89f7cd3ce Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:50:57 +0530 Subject: [PATCH] fix: restore Save button on reverse journal entry (backport #56770) (#56772) fix: restore Save button on reverse journal entry (#56770) Reversing a submitted Journal Entry opened a draft with reversal_of set, which called frm.set_read_only(). That strips the write and submit perms from frm.perm, so the toolbar never rendered the Save (or later Submit) button and the reversal could not be saved. Lock the fields and the accounts grid as read_only instead, leaving perms intact so Save and Submit still work while nothing stays editable. Ticket: 72857 (cherry picked from commit 0a05dd44264812dcfdeaac7aca2dbb193f64c989) Co-authored-by: Jatin3128 <140256508+Jatin3128@users.noreply.github.com> --- erpnext/accounts/doctype/journal_entry/journal_entry.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index b1dc0c477b7..4659f3e2b4b 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -71,7 +71,7 @@ frappe.ui.form.on("Journal Entry", { refresh: function (frm) { if (frm.doc.reversal_of && (frm.is_new() || frm.doc.docstatus == 0)) { - frm.set_read_only(); + erpnext.journal_entry.lock_reversal_entry(frm); } erpnext.toggle_naming_series(); @@ -564,6 +564,13 @@ $.extend(erpnext.journal_entry, { }); }, + lock_reversal_entry: function (frm) { + frm.fields + .filter((field) => field.has_input) + .forEach((field) => frm.set_df_property(field.df.fieldname, "read_only", 1)); + frm.set_df_property("accounts", "read_only", 1); + }, + set_debit_credit_in_company_currency: function (frm, cdt, cdn) { var row = locals[cdt][cdn];