[fix] Group account merging with sub-ordinate group

This commit is contained in:
Nabin Hait 2015-12-17 12:53:25 +05:30
parent 824122c42a
commit adab5d308c

View File

@ -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