Strip party name before checking for account

This commit is contained in:
Nabin Hait 2014-09-16 12:25:41 +05:30
parent c25681c36c
commit 9d610214cf

View File

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