From 4f9ac0ad55801d5b5aef85e519f30009cc4e265a Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 25 Mar 2019 11:39:25 +0530 Subject: [PATCH] fix: Child company account currency fix --- erpnext/accounts/doctype/account/account.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 427f3dba20..472196e67d 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -98,7 +98,10 @@ class Account(NestedSet): ancestors = get_root_company(self.company) if ancestors: - frappe.throw(_("Please add the account to root level Company - %s" % ancestors[0])) + account = frappe.db.exists("Account", {"company": ancestors[0], "account_name": self.account_name}) + + if not account: + frappe.throw(_("Please add the account to root level Company - %s" % ancestors[0])) else: descendants = get_descendants_of('Company', self.company) if not descendants: return