From adab5d308cf94a8f07b7416e6efa5323c67ae88f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 17 Dec 2015 12:53:25 +0530 Subject: [PATCH] [fix] Group account merging with sub-ordinate group --- erpnext/accounts/doctype/account/account.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 5c6aecd31f..cc6157f36c 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -199,6 +199,10 @@ class Account(Document): if val != [self.is_group, self.root_type, self.company]: throw(_("""Merging is only possible if following properties are same in both records. Is Group, Root Type, Company""")) + + if self.is_group and frappe.db.get_value("Account", new, "parent_account") == old: + frappe.db.set_value("Account", new, "parent_account", + frappe.db.get_value("Account", old, "parent_account")) return new_account