mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
Validation added to prevent user to Manage Variants if Item Template is Unsaved. Prevented message stating variants updated while saving item template if there are no variants against that item Template
This commit is contained in:
@@ -86,9 +86,13 @@ frappe.ui.form.on("Item", {
|
||||
},
|
||||
|
||||
manage_variants: function(frm) {
|
||||
if (cur_frm.doc.__unsaved==1) {
|
||||
frappe.throw(__("You have unsaved changes. Please save."))
|
||||
} else {
|
||||
frappe.route_options = {"item_code": frm.doc.name };
|
||||
frappe.set_route("List", "Manage Variants");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.extend(erpnext.item, {
|
||||
|
||||
@@ -325,6 +325,7 @@ class Item(WebsiteGenerator):
|
||||
for d in variants:
|
||||
update_variant(self.name, d)
|
||||
updated.append(d.item_code)
|
||||
if updated:
|
||||
frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))
|
||||
|
||||
def validate_has_variants(self):
|
||||
|
||||
Reference in New Issue
Block a user