From 3a573d1a6d20651b45cc36f88cd367b0c203609f Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Wed, 21 Oct 2015 12:20:06 +0530 Subject: [PATCH] Prevent Template Item from going into infinite loop while saving --- erpnext/stock/doctype/item/item.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 9c4ccdcaf11..7c0d0e0165b 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -412,10 +412,11 @@ 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.has_variants: + if self.has_variants and not self.flags.dont_update_variants: updated = [] variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name }) for d in variants: