Example #1
1
def before_tests():
	frappe.clear_cache()
	# complete setup if missing
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
	if not frappe.get_list("Company"):
		setup_complete({
			"currency"			:"USD",
			"first_name"		:"Test",
			"last_name"			:"User",
			"company_name"		:"Wind Power LLC",
			"timezone"			:"America/New_York",
			"company_abbr"		:"WP",
			"industry"			:"Manufacturing",
			"country"			:"United States",
			"fy_start_date"		:"2014-01-01",
			"fy_end_date"		:"2014-12-31",
			"language"			:"english",
			"company_tagline"	:"Testing",
			"email"				:"*****@*****.**",
			"password"			:"test",
			"chart_of_accounts" : "Standard"
		})

	frappe.db.sql("delete from `tabLeave Allocation`")
	frappe.db.sql("delete from `tabLeave Application`")
	frappe.db.sql("delete from `tabSalary Slip`")
	frappe.db.sql("delete from `tabItem Price`")

	frappe.db.set_value("Stock Settings", None, "auto_insert_price_list_rate_if_missing", 0)

	frappe.db.commit()
Example #2
0
def complete_setup():
    from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
    setup_complete({
        "first_name": "Demo",
        "last_name": "User",
        "email": "*****@*****.**",
        "company_tagline": "Inspiring Minds",
        "password": "******",
        "fy_start_date": "2015-01-01",
        "fy_end_date": "2015-12-31",
        "industry": "Education",
        "company_name": "Whitemore College",
        "chart_of_accounts": "Standard",
        "company_abbr": "WC",
        "country": "United States",
        "currency": "USD",
        "timezone": "America/New_York",
        "bank_name": "Citibank",
        "language": "english"
    })

    # home page should always be "start"
    website_settings = frappe.get_doc("Website Settings", "Website Settings")
    website_settings.home_page = "start"
    website_settings.save()

    frappe.clear_cache()
Example #3
0
def before_tests():
	if len(frappe.get_installed_apps()) > 1:
		# don't run before tests if any other app is installed
		return

	frappe.db.sql("delete from `tabCustom Field`")
	frappe.db.sql("delete from `tabEvent`")
	frappe.db.commit()
	frappe.clear_cache()

	# complete setup if missing
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
	if not int(frappe.db.get_single_value('System Settings', 'setup_complete') or 0):
		setup_complete({
			"language"			:"english",
			"email"				:"*****@*****.**",
			"full_name"			:"Test User",
			"password"			:"test",
			"country"			:"United States",
			"timezone"			:"America/New_York",
			"currency"			:"USD"
		})

	frappe.db.commit()
	frappe.clear_cache()
Example #4
0
def complete_setup(domain='Manufacturing'):
	print("Complete Setup...")
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete

	if not frappe.get_all('Company', limit=1):
		setup_complete({
			"full_name": "Test User",
			"email": "*****@*****.**",
			"company_tagline": 'Awesome Products and Services',
			"password": "******",
			"fy_start_date": "2015-01-01",
			"fy_end_date": "2015-12-31",
			"bank_account": "National Bank",
			"domains": [domain],
			"company_name": data.get(domain).get('company_name'),
			"chart_of_accounts": "Standard",
			"company_abbr": ''.join([d[0] for d in data.get(domain).get('company_name').split()]).upper(),
			"currency": 'USD',
			"timezone": 'America/New_York',
			"country": 'United States',
			"language": "english"
		})

		company = erpnext.get_default_company()

		if company:
			company_doc = frappe.get_doc("Company", company)
			company_doc.db_set('default_payroll_payable_account',
				frappe.db.get_value('Account', dict(account_name='Payroll Payable')))
Example #5
0
def complete_setup(domain='Manufacturing'):
	print "Complete Setup..."
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete

	if not frappe.get_all('Company', limit=1):
		setup_complete({
			"full_name": "Test User",
			"email": "*****@*****.**",
			"company_tagline": 'Awesome Products and Services',
			"password": "******",
			"fy_start_date": "2015-01-01",
			"fy_end_date": "2015-12-31",
			"bank_account": "National Bank",
			"domain": domain,
			"company_name": data.get(domain).get('company_name'),
			"chart_of_accounts": "Standard",
			"company_abbr": ''.join([d[0] for d in data.get(domain).get('company_name').split()]).upper(),
			"currency": 'USD',
			"timezone": 'America/New_York',
			"country": 'United States',
			"language": "english"
		})

		company = erpnext.get_default_company()

		if company:
			company_doc = frappe.get_doc("Company", company)
			company_doc.db_set('default_payroll_payable_account',
				frappe.db.get_value('Account', dict(account_name='Payroll Payable')))
Example #6
0
def before_tests():
    frappe.clear_cache()
    # complete setup if missing
    from frappe.desk.page.setup_wizard.setup_wizard import setup_complete

    if not frappe.db.a_row_exists("Company"):
        current_year = now_datetime().year
        setup_complete({
            "currency": "USD",
            "full_name": "Test User",
            "company_name": "Wind Power LLC",
            "timezone": "America/New_York",
            "company_abbr": "WP",
            "industry": "Manufacturing",
            "country": "United States",
            "fy_start_date": f"{current_year}-01-01",
            "fy_end_date": f"{current_year}-12-31",
            "language": "english",
            "company_tagline": "Testing",
            "email": "*****@*****.**",
            "password": "******",
            "chart_of_accounts": "Standard",
        })

    frappe.db.sql("delete from `tabLeave Allocation`")
    frappe.db.sql("delete from `tabLeave Application`")
    frappe.db.sql("delete from `tabSalary Slip`")
    frappe.db.sql("delete from `tabItem Price`")

    _enable_all_roles_for_admin()

    set_defaults_for_tests()

    frappe.db.commit()
Example #7
0
def before_tests():
    if len(frappe.get_installed_apps()) > 1:
        # don't run before tests if any other app is installed
        return

    frappe.db.sql("delete from `tabCustom Field`")
    frappe.db.sql("delete from `tabEvent`")
    frappe.db.commit()
    frappe.clear_cache()

    # complete setup if missing
    from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
    if not int(
            frappe.db.get_single_value('System Settings', 'setup_complete')
            or 0):
        setup_complete({
            "language": "english",
            "email": "*****@*****.**",
            "full_name": "Test User",
            "password": "******",
            "country": "United States",
            "timezone": "America/New_York",
            "currency": "USD"
        })

    frappe.db.commit()
    frappe.clear_cache()
Example #8
0
def complete():
	with open(os.path.join(os.path.dirname(__file__),
		'data', 'test_mfg.json'), 'r') as f:
		data = json.loads(f.read())

	#setup_wizard.create_sales_tax(data)
	setup_complete(data)
Example #9
0
def complete_setup():
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
	setup_complete({
		"first_name": "Demo",
		"last_name": "User",
		"email": "*****@*****.**",
		"company_tagline": "Inspiring Minds",
		"password": "******",
		"fy_start_date": "2015-01-01",
		"fy_end_date": "2015-12-31",
		"industry": "Education",
		"company_name": "Whitemore College",
		"chart_of_accounts": "Standard",
		"company_abbr": "WC",
		"country": "United States",
		"currency": "USD",
		"timezone": "America/New_York",
		"bank_name": "Citibank",
		"language": "english"
	})

	# home page should always be "start"
	website_settings = frappe.get_doc("Website Settings", "Website Settings")
	website_settings.home_page = "start"
	website_settings.save()

	frappe.clear_cache()
Example #10
0
def complete_setup(domain='Manufacturing'):
	print("Complete Setup...")
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
	if not frappe.get_all('Company', limit=1):
		setup_complete({
			"full_name": "Test User",
			"email": "*****@*****.**",
			"company_tagline": 'Awesome Products and Services',
			"password": "******",
			"fy_start_date": "2020-01-01",
			"fy_end_date": "2020-12-31",
			"bank_account": "Banque Nationale",
			"domains": [domain],
			"company_name": data.get(domain).get('company_name'),
			"chart_of_accounts": "Standard",
			"company_abbr": ''.join([d[0] for d in data.get(domain).get('company_name').split()]).upper(),
			"currency": 'EUR',
			"timezone": 'Europe/Paris',
			"country": 'France',
			"language": "Français",
			"lang": frappe.flags.demo_lang,
			"demo": 1
		})

		company = erpnext.get_default_company()

		if company:
			company_doc = frappe.get_doc("Company", company)
			company_doc.db_set('default_payroll_payable_account',
				frappe.db.get_value('Account', dict(account_name='Payroll Payable')))
Example #11
0
def before_tests():
    frappe.clear_cache()
    # complete setup if missing
    from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
    if not frappe.get_list("Company"):
        setup_complete({
            "currency": "USD",
            "full_name": "Test User",
            "company_name": "Wind Power LLC",
            "timezone": "America/New_York",
            "company_abbr": "WP",
            "industry": "Manufacturing",
            "country": "United States",
            "fy_start_date": "2011-01-01",
            "fy_end_date": "2011-12-31",
            "language": "english",
            "company_tagline": "Testing",
            "email": "*****@*****.**",
            "password": "******",
            "chart_of_accounts": "Standard",
            "domain": "Manufacturing"
        })

    frappe.db.sql("delete from `tabLeave Allocation`")
    frappe.db.sql("delete from `tabLeave Application`")
    frappe.db.sql("delete from `tabSalary Slip`")
    frappe.db.sql("delete from `tabItem Price`")

    frappe.db.set_value("Stock Settings", None,
                        "auto_insert_price_list_rate_if_missing", 0)
    enable_all_roles_and_domains()

    frappe.db.commit()
Example #12
0
def complete_setup_wizard():
    from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
    setup_complete({
        "language": "English",
        "email": "*****@*****.**",
        "full_name": "Test User",
        "password": "******",
        "country": "United States",
        "timezone": "America/New_York",
        "currency": "USD"
    })
Example #13
0
def before_tests():
    frappe.clear_cache()
    # complete setup if missing
    from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
    if not frappe.get_list("Company"):
        setup_complete({
            "currency": "USD",
            "full_name": "Test User",
            "company_name": "Wind Power LLC",
            "timezone": "America/New_York",
            "company_abbr": "WP",
            "industry": "Manufacturing",
            "country": "United States",
            "fy_start_date": "2011-01-01",
            "fy_end_date": "2011-12-31",
            "language": "english",
            "company_tagline": "Testing",
            "email": "*****@*****.**",
            "password": "******",
            "chart_of_accounts": "Standard",
            "domains": ["Manufacturing"],
        })

    frappe.db.sql("delete from `tabLeave Allocation`")
    frappe.db.sql("delete from `tabLeave Application`")
    frappe.db.sql("delete from `tabSalary Slip`")
    frappe.db.sql("delete from `tabItem Price`")

    frappe.db.set_value("Stock Settings", None,
                        "auto_insert_price_list_rate_if_missing", 0)
    enable_all_roles_and_domains()

    if not frappe.db.exists('Company', 'Woocommerce'):
        company = frappe.new_doc("Company")
        company.company_name = "Woocommerce"
        company.abbr = "W"
        company.default_currency = "INR"
        company.save()

    woo_settings = frappe.get_doc("Woocommerce Settings")
    if not woo_settings.secret:
        woo_settings.secret = "ec434676aa1de0e502389f515c38f89f653119ab35e9117c7a79e576"
        woo_settings.woocommerce_server_url = "https://woocommerce.mntechnique.com/"
        woo_settings.api_consumer_key = "ck_fd43ff5756a6abafd95fadb6677100ce95a758a1"
        woo_settings.api_consumer_secret = "cs_94360a1ad7bef7fa420a40cf284f7b3e0788454e"
        woo_settings.enable_sync = 1
        woo_settings.tax_account = "Sales Expenses - W"
        woo_settings.f_n_f_account = "Expenses - W"
        woo_settings.save(ignore_permissions=True)

    frappe.db.commit()
Example #14
0
def before_tests():
	frappe.clear_cache()
	# complete setup if missing
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
	if not frappe.get_list("Company"):
		setup_complete({
			"currency"			:"USD",
			"full_name"			:"Test User",
			"company_name"		:"Wind Power LLC",
			"timezone"			:"America/New_York",
			"company_abbr"		:"WP",
			"industry"			:"Manufacturing",
			"country"			:"United States",
			"fy_start_date"		:"2011-01-01",
			"fy_end_date"		:"2011-12-31",
			"language"			:"english",
			"company_tagline"	:"Testing",
			"email"				:"*****@*****.**",
			"password"			:"test",
			"chart_of_accounts" : "Standard",
			"domains"			: ["Manufacturing"],
		})

	frappe.db.sql("delete from `tabLeave Allocation`")
	frappe.db.sql("delete from `tabLeave Application`")
	frappe.db.sql("delete from `tabSalary Slip`")
	frappe.db.sql("delete from `tabItem Price`")

	frappe.db.set_value("Stock Settings", None, "auto_insert_price_list_rate_if_missing", 0)
	enable_all_roles_and_domains()

	if not frappe.db.exists('Company', 'Woocommerce'):
		company = frappe.new_doc("Company")
		company.company_name = "Woocommerce"
		company.abbr = "W"
		company.default_currency = "INR"
		company.save()

	woo_settings = frappe.get_doc("Woocommerce Settings")
	if not woo_settings.secret:
		woo_settings.secret = "ec434676aa1de0e502389f515c38f89f653119ab35e9117c7a79e576"
		woo_settings.woocommerce_server_url = "https://woocommerce.mntechnique.com/"
		woo_settings.api_consumer_key = "ck_fd43ff5756a6abafd95fadb6677100ce95a758a1"
		woo_settings.api_consumer_secret = "cs_94360a1ad7bef7fa420a40cf284f7b3e0788454e"
		woo_settings.enable_sync = 1
		woo_settings.tax_account = "Sales Expenses - W"
		woo_settings.f_n_f_account = "Expenses - W"
		woo_settings.save(ignore_permissions=True)

	frappe.db.commit()
Example #15
0
def complete_setup(domain='Manufacturing'):
    print "Complete Setup..."
    from frappe.desk.page.setup_wizard.setup_wizard import setup_complete

    if not frappe.get_all('Company', limit=1):
        setup_complete({
            "first_name":
            "Test",
            "last_name":
            "User",
            "email":
            "*****@*****.**",
            "company_tagline":
            'Awesome Products and Services',
            "password":
            "******",
            "fy_start_date":
            "2015-01-01",
            "fy_end_date":
            "2015-12-31",
            "bank_account":
            "National Bank",
            "domain":
            domain,
            "company_name":
            data.get(domain).get('company_name'),
            "chart_of_accounts":
            "Standard",
            "company_abbr":
            ''.join([
                d[0] for d in data.get(domain).get('company_name').split()
            ]).upper(),
            "currency":
            'USD',
            "timezone":
            'America/New_York',
            "country":
            'United States',
            "language":
            "english"
        })
Example #16
0
def complete_setup():
	print "Complete Setup..."
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
	setup_complete({
		"first_name": "Test",
		"last_name": "User",
		"email": "*****@*****.**",
		"company_tagline": "Wind Mills for a Better Tomorrow",
		"password": "******",
		"fy_start_date": "2015-01-01",
		"fy_end_date": "2015-12-31",
		"industry": "Manufacturing",
		"company_name": settings.company,
		"chart_of_accounts": "Standard",
		"company_abbr": settings.company_abbr,
		"currency": settings.currency,
		"timezone": settings.time_zone,
		"country": settings.country,
		"language": "english"
	})

	# home page should always be "start"
	website_settings = frappe.get_doc("Website Settings", "Website Settings")
	website_settings.home_page = "start"
	website_settings.save()

	for year in xrange(2014, frappe.utils.now_datetime().year + 1, 1):
		try:
			frappe.get_doc({
				"doctype": "Fiscal Year",
				"year": frappe.utils.cstr(year),
				"year_start_date": "{0}-01-01".format(year),
				"year_end_date": "{0}-12-31".format(year)
			}).insert()
		except frappe.DuplicateEntryError:
			pass

	import_data("Holiday List")

	frappe.clear_cache()
Example #17
0
def complete_setup():
	print "Complete Setup..."
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
	setup_complete({
		"first_name": "Test",
		"last_name": "User",
		"email": "*****@*****.**",
		"company_tagline": "Wind Mills for a Better Tomorrow",
		"password": "******",
		"fy_start_date": "2015-01-01",
		"fy_end_date": "2015-12-31",
		"industry": "Manufacturing",
		"company_name": settings.company,
		"chart_of_accounts": "Standard",
		"company_abbr": settings.company_abbr,
		"currency": settings.currency,
		"timezone": settings.time_zone,
		"country": settings.country,
		"language": "english"
	})

	# home page should always be "start"
	website_settings = frappe.get_doc("Website Settings", "Website Settings")
	website_settings.home_page = "start"
	website_settings.save()

	for year in xrange(2014, frappe.utils.now_datetime().year + 1, 1):
		try:
			frappe.get_doc({
				"doctype": "Fiscal Year",
				"year": frappe.utils.cstr(year),
				"year_start_date": "{0}-01-01".format(year),
				"year_end_date": "{0}-12-31".format(year)
			}).insert()
		except frappe.DuplicateEntryError:
			pass

	import_data("Holiday List")

	frappe.clear_cache()
Example #18
0
def complete_setup(domain='Manufacturing'):
	print "Complete Setup..."
	from frappe.desk.page.setup_wizard.setup_wizard import setup_complete

	if not frappe.get_all('Company', limit=1):
		setup_complete({
			"first_name": "Test",
			"last_name": "User",
			"email": "*****@*****.**",
			"company_tagline": 'Awesome Products and Services',
			"password": "******",
			"fy_start_date": "2015-01-01",
			"fy_end_date": "2015-12-31",
			"bank_account": "National Bank",
			"domain": domain,
			"company_name": data.get(domain).get('company_name'),
			"chart_of_accounts": "Standard",
			"company_abbr": ''.join([d[0] for d in data.get(domain).get('company_name').split()]).upper(),
			"currency": 'USD',
			"timezone": 'America/New_York',
			"country": 'United States',
			"language": "english"
		})
Example #19
0
def initalize_site():
    print("Initialization...")
    from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
    if not frappe.get_all('Company', limit=1):
        completed = setup_complete({
            "full_name": "Thierry Lussier",
            "email": "*****@*****.**",
            "company_tagline": 'Mon Tiers Lieux',
            "password": "******",
            "fy_start_date": "2020-01-01",
            "fy_end_date": "2020-12-31",
            "bank_account": "Banque Nationale",
            "domains": ["Venue"],
            "company_name": "Mon Tiers Lieux",
            "chart_of_accounts": "Plan Comptable Général",
            "company_abbr": "MTL",
            "currency": 'EUR',
            "timezone": 'Europe/Paris',
            "country": 'France',
            "language": "Français",
            "lang": "fr",
            "demo": 1
        })
        print(completed)
Example #20
0
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import frappe

from erpnext.setup.setup_wizard.test_setup_data import args
from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
import frappe.utils.scheduler

if __name__=="__main__":
	frappe.connect()
	frappe.local.form_dict = frappe._dict(args)
	setup_complete()
	frappe.utils.scheduler.disable_scheduler()
Example #21
0
def complete():
    with open(os.path.join(os.path.dirname(__file__), "data", "test_mfg.json"),
              "r") as f:
        data = json.loads(f.read())

    setup_complete(data)
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import frappe

from erpnext.setup.setup_wizard.test_setup_data import args
from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
import frappe.utils.scheduler

if __name__ == "__main__":
    frappe.connect()
    frappe.local.form_dict = frappe._dict(args)
    setup_complete()
    frappe.utils.scheduler.disable_scheduler()
Example #23
0
def complete():
	with open(os.path.join(os.path.dirname(__file__),
		'data', 'test_mfg.json'), 'r') as f:
		data = json.loads(f.read())

	setup_complete(data)