From 82a1561120604f363c4a10a80bab3020a5331d30 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 30 Dec 2015 14:27:49 +0530 Subject: [PATCH] [fix] Create bank accounts from setup wizard #4546 --- erpnext/setup/setup_wizard/setup_wizard.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py index 4d4cc6d1441..9892e71eaea 100644 --- a/erpnext/setup/setup_wizard/setup_wizard.py +++ b/erpnext/setup/setup_wizard/setup_wizard.py @@ -106,8 +106,23 @@ def create_fiscal_year_and_company(args): }).insert() # Bank Account + create_bank_account(args) args["curr_fiscal_year"] = curr_fiscal_year + +def create_bank_account(args): + if args.get("bank_account"): + bank_account_group = frappe.db.get_value("Account", + {"account_type": "Bank", "is_group": 1, "root_type": "Asset"}) + if bank_account_group: + frappe.get_doc({ + "doctype": "Account", + 'account_name': args.get("bank_account"), + 'parent_account': bank_account_group, + 'is_group':0, + 'company':args.get('company_name').strip(), + "account_type": "Bank", + }).insert() def create_price_lists(args): for pl_type, pl_name in (("Selling", _("Standard Selling")), ("Buying", _("Standard Buying"))):