From 424baed077b365a1b21eb8602e210a5a49ce6b6b Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 29 Jul 2025 16:26:57 +0530 Subject: [PATCH] fix: ignore is overridden by transaction.js upon clicking cancel which overrides with 'Serial and Batch Bundle' (cherry picked from commit cf70147c0d8e7324cc5261a59c398c34039f09dc) --- erpnext/buying/doctype/purchase_order/purchase_order.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 7925d59d25a..bdd5e89dda0 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -12,7 +12,6 @@ erpnext.buying.setup_buying_controller(); frappe.ui.form.on("Purchase Order", { setup: function (frm) { - frm.ignore_doctypes_on_cancel_all = ["Unreconcile Payment", "Unreconcile Payment Entries"]; if (frm.doc.is_old_subcontracting_flow) { frm.set_query("reserve_warehouse", "supplied_items", function () { return { @@ -140,6 +139,10 @@ frappe.ui.form.on("Purchase Order", { }, onload: function (frm) { + var ignore_list = ["Unreconcile Payment", "Unreconcile Payment Entries"]; + frm.ignore_doctypes_on_cancel_all = Object.hasOwn(frm, "ignore_doctypes_on_cancel_all") + ? frm.ignore_doctypes_on_cancel_all.concat(ignore_list) + : ignore_list; set_schedule_date(frm); if (!frm.doc.transaction_date) { frm.set_value("transaction_date", frappe.datetime.get_today());