mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-19 06:45:11 +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) => {
|
erpnext.set_unit_price_items_note = (frm) => {
|
||||||
if (frm.doc.has_unit_price_items && !frm.is_new()) {
|
if (frm.doc.has_unit_price_items && !frm.is_new()) {
|
||||||
frm.dashboard.set_headline_alert(
|
// Remove existing note
|
||||||
__("The {0} contains Unit Price Items with 0 Qty.", [__(frm.doc.doctype)]),
|
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",
|
"yellow",
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user