From d1d835347efd837efb53531e9b7449aa214bb2b8 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Wed, 30 Oct 2019 14:45:11 +0530 Subject: [PATCH] fix: Pass parent_acc_name --- erpnext/accounts/doctype/account/account.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 69fc5ba7de0..cccced8e0be 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -117,7 +117,7 @@ class Account(NestedSet): if not parent_acc_name_map: return - self.create_account_for_child_company(parent_acc_name_map, descendants) + self.create_account_for_child_company(parent_acc_name_map, descendants, parent_acc_name) def validate_group_or_ledger(self): if self.get("__islocal"): @@ -159,11 +159,11 @@ class Account(NestedSet): if frappe.db.get_value("GL Entry", {"account": self.name}): frappe.throw(_("Currency can not be changed after making entries using some other currency")) - def create_account_for_child_company(self, parent_acc_name_map, descendants): + def create_account_for_child_company(self, parent_acc_name_map, descendants, parent_acc_name): for company in descendants: if not parent_acc_name_map.get(company): frappe.throw(_("While creating account for child Company {0}, parent account {1} not found. Please create the parent account in corresponding COA") - .format(company, parent_acc_name_map)) + .format(company, parent_acc_name)) filters = { "account_name": self.account_name,