[fix] warehouse account rename fix #6526
diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py
index f657ebf..8e7941c 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.py
+++ b/erpnext/stock/doctype/warehouse/warehouse.py
@@ -150,7 +150,10 @@
 		return new_warehouse
 
 	def rename_account_for(self, olddn, newdn, merge):
-		old_account = self.get_account(olddn)
+		if self.is_group:
+			old_account = self.get_account()
+		else:
+			old_account = self.get_account(olddn)
 
 		if old_account:
 			new_account = None