diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 3b8f6e4ac7..f2780bf67c 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -100,7 +100,6 @@ class Item(WebsiteGenerator): invalidate_cache_for_item(self) self.validate_name_with_item_group() self.update_item_price() - self.update_variants() self.update_template_item() def add_price(self, price_list=None): @@ -612,23 +611,8 @@ class Item(WebsiteGenerator): if not template_item.show_in_website: template_item.show_in_website = 1 template_item.flags.ignore_permissions = True - template_item.flags.dont_update_variants = True template_item.save() - def update_variants(self): - if self.flags.dont_update_variants: - return - if self.has_variants: - updated = [] - variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name }) - for d in variants: - variant = frappe.get_doc("Item", d) - copy_attributes_to_variant(self, variant) - variant.save() - updated.append(d.item_code) - if updated: - frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated))) - def validate_has_variants(self): if not self.has_variants and frappe.db.get_value("Item", self.name, "has_variants"): if frappe.db.exists("Item", {"variant_of": self.name}):