[fix] Clear website cache for Item Group on saving Item
diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py
index 944dfb1..59a0ecb 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -102,7 +102,8 @@
 	if not item_group:
 		item_group = doc.name
 
-	for i in get_parent_item_groups(item_group):
-		route = doc.get_route()
+	for d in get_parent_item_groups(item_group):
+		d = frappe.get_doc("Item Group", d.name)
+		route = d.get_route()
 		if route:
 			clear_cache(route)
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index c158014..17fe0ae 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -374,5 +374,5 @@
 	for item_group in website_item_groups:
 		invalidate_cache_for(doc, item_group)
 
-	if doc.get("old_item_group"):
+	if doc.get("old_item_group") and doc.get("old_item_group") != doc.item_group:
 		invalidate_cache_for(doc, doc.old_item_group)