Merge pull request #2315 from nabinhait/stock_reco

Strip company in setup wizard
This commit is contained in:
Nabin Hait 2014-10-15 13:59:07 +05:30
commit 3b7342b7b5

View File

@ -71,7 +71,7 @@ def setup_account(args=None):
frappe.db.set_default('desktop:home_page', 'desktop') frappe.db.set_default('desktop:home_page', 'desktop')
website_maker(args.company_name, args.company_tagline, args.name) website_maker(args.company_name.strip(), args.company_tagline, args.name)
create_logo(args) create_logo(args)
frappe.clear_cache() frappe.clear_cache()
@ -135,7 +135,7 @@ def create_fiscal_year_and_company(args):
frappe.get_doc({ frappe.get_doc({
"doctype":"Company", "doctype":"Company",
'domain': args.get("industry"), 'domain': args.get("industry"),
'company_name':args.get('company_name'), 'company_name':args.get('company_name').strip(),
'abbr':args.get('company_abbr'), 'abbr':args.get('company_abbr'),
'default_currency':args.get('currency'), 'default_currency':args.get('currency'),
'country': args.get('country'), 'country': args.get('country'),
@ -166,7 +166,7 @@ def set_defaults(args):
global_defaults.update({ global_defaults.update({
'current_fiscal_year': args.curr_fiscal_year, 'current_fiscal_year': args.curr_fiscal_year,
'default_currency': args.get('currency'), 'default_currency': args.get('currency'),
'default_company':args.get('company_name'), 'default_company':args.get('company_name').strip(),
"country": args.get("country"), "country": args.get("country"),
}) })
@ -285,7 +285,7 @@ def create_taxes(args):
try: try:
frappe.get_doc({ frappe.get_doc({
"doctype":"Account", "doctype":"Account",
"company": args.get("company_name"), "company": args.get("company_name").strip(),
"parent_account": _("Duties and Taxes") + " - " + args.get("company_abbr"), "parent_account": _("Duties and Taxes") + " - " + args.get("company_abbr"),
"account_name": args.get("tax_" + str(i)), "account_name": args.get("tax_" + str(i)),
"group_or_ledger": "Ledger", "group_or_ledger": "Ledger",
@ -345,7 +345,7 @@ def create_customers(args):
"customer_type": "Company", "customer_type": "Company",
"customer_group": _("Commercial"), "customer_group": _("Commercial"),
"territory": args.get("country"), "territory": args.get("country"),
"company": args.get("company_name") "company": args.get("company_name").strip()
}).insert() }).insert()
if args.get("customer_contact_" + str(i)): if args.get("customer_contact_" + str(i)):
@ -365,7 +365,7 @@ def create_suppliers(args):
"doctype":"Supplier", "doctype":"Supplier",
"supplier_name": supplier, "supplier_name": supplier,
"supplier_type": _("Local"), "supplier_type": _("Local"),
"company": args.get("company_name") "company": args.get("company_name").strip()
}).insert() }).insert()
if args.get("supplier_contact_" + str(i)): if args.get("supplier_contact_" + str(i)):