From 9d610214cf4fc57a605eeb5681d65e3446f9819b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 16 Sep 2014 12:25:41 +0530 Subject: [PATCH] Strip party name before checking for account --- erpnext/accounts/party.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index cd172f1902..de7032e3b1 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -163,7 +163,7 @@ def create_party_account(party, party_type, company): company_details = frappe.db.get_value("Company", company, ["abbr", "receivables_group", "payables_group"], as_dict=True) - if not frappe.db.exists("Account", (party + " - " + company_details.abbr)): + if not frappe.db.exists("Account", (party.strip() + " - " + company_details.abbr)): parent_account = company_details.receivables_group \ if party_type=="Customer" else company_details.payables_group if not parent_account: