From f94a14c06ae63afcfe4d6d33757f80bc1f068002 Mon Sep 17 00:00:00 2001 From: marination <25857446+marination@users.noreply.github.com> Date: Mon, 17 Mar 2025 19:26:45 +0100 Subject: [PATCH] fix: Headline rendered twice on first save - `refresh` gets triggered twice and that renders the note twice - Remove any existing note before rendering (cherry picked from commit bf62f9ad578e9d655451088398eaaa2f772348c7) --- erpnext/public/js/controllers/transaction.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 886ddd2acc0..b7706028114 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -2776,8 +2776,14 @@ erpnext.apply_putaway_rule = (frm, purpose=null) => { erpnext.set_unit_price_items_note = (frm) => { if (frm.doc.has_unit_price_items && !frm.is_new()) { - frm.dashboard.set_headline_alert( - __("The {0} contains Unit Price Items with 0 Qty.", [__(frm.doc.doctype)]), + // Remove existing note + const $note = $(frm.layout.wrapper.find(".unit-price-items-note")); + if ($note.length) { $note.parent().remove(); } + + frm.layout.show_message( + `