fix: Test Cases

This commit is contained in:
Deepesh Garg 2021-06-23 15:37:17 +05:30
parent 35e11fbea6
commit 0bfffddac4

View File

@ -483,14 +483,14 @@ def create_bank_account(args):
if not args.get('bank_account'):
return
company_name = args.company_name
company_name = args.get('company_name')
bank_account_group = frappe.db.get_value("Account",
{"account_type": "Bank", "is_group": 1, "root_type": "Asset",
"company": company_name})
if bank_account_group:
bank_account = frappe.get_doc({
"doctype": "Account",
'account_name': args.bank_account,
'account_name': args.get('bank_account'),
'parent_account': bank_account_group,
'is_group':0,
'company': company_name,
@ -499,10 +499,10 @@ def create_bank_account(args):
try:
doc = bank_account.insert()
frappe.db.set_value("Company", args.company_name, "default_bank_account", bank_account.name, update_modified=False)
frappe.db.set_value("Company", args.get('company_name'), "default_bank_account", bank_account.name, update_modified=False)
except RootNotEditable:
frappe.throw(_("Bank account cannot be named as {0}").format(args.bank_account))
frappe.throw(_("Bank account cannot be named as {0}").format(args.get('bank_account')))
except frappe.DuplicateEntryError:
# bank account same as a CoA entry
pass