mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-21 10:26:30 +00:00
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 bf62f9ad57)
This commit is contained in:
@@ -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(
|
||||
`<div class="unit-price-items-note">
|
||||
${__("The {0} contains Unit Price Items.", [__(frm.doc.doctype)])}
|
||||
</div>`,
|
||||
"yellow",
|
||||
true
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user