Merge pull request #3713 from neilLasrado/manage-variants
Fixes for Item Variants
This commit is contained in:
commit
41b4864f0c
@ -86,9 +86,13 @@ frappe.ui.form.on("Item", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
manage_variants: function(frm) {
|
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.route_options = {"item_code": frm.doc.name };
|
||||||
frappe.set_route("List", "Manage Variants");
|
frappe.set_route("List", "Manage Variants");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$.extend(erpnext.item, {
|
$.extend(erpnext.item, {
|
||||||
|
@ -325,6 +325,7 @@ class Item(WebsiteGenerator):
|
|||||||
for d in variants:
|
for d in variants:
|
||||||
update_variant(self.name, d)
|
update_variant(self.name, d)
|
||||||
updated.append(d.item_code)
|
updated.append(d.item_code)
|
||||||
|
if updated:
|
||||||
frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))
|
frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated)))
|
||||||
|
|
||||||
def validate_has_variants(self):
|
def validate_has_variants(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user