From 946e182564ad6bb3f95a719120d611c0fe459963 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Wed, 27 Sep 2017 11:44:39 +0530 Subject: [PATCH] install company fixtures while creating company (#10904) * install company fixtures while creating company * [fix] remove from setup_complete --- erpnext/hooks.py | 1 - erpnext/setup/doctype/company/company.py | 6 +----- erpnext/setup/setup_wizard/setup_wizard.py | 4 ---- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 8306290f723..668796531da 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -27,7 +27,6 @@ doctype_js = { # setup wizard setup_wizard_requires = "assets/erpnext/js/setup_wizard.js" setup_wizard_complete = "erpnext.setup.setup_wizard.setup_wizard.setup_complete" -setup_wizard_success = "erpnext.setup.setup_wizard.setup_wizard.setup_success" setup_wizard_test = "erpnext.setup.setup_wizard.test_setup_wizard.run_setup_wizard_test" before_install = "erpnext.setup.install.check_setup_wizard_not_completed" diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 0459e84b252..4884c06343a 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -75,11 +75,7 @@ class Company(Document): if not frappe.local.flags.ignore_chart_of_accounts: self.create_default_accounts() self.create_default_warehouses() - - if cint(frappe.db.get_single_value('System Settings', 'setup_complete')): - # In the case of setup, fixtures should be installed after setup_success - # This also prevents db commits before setup is successful - install_country_fixtures(self.name) + install_country_fixtures(self.name) if not frappe.db.get_value("Cost Center", {"is_group": 0, "company": self.name}): self.create_default_cost_center() diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py index bf9221784c0..a80399d905c 100644 --- a/erpnext/setup/setup_wizard/setup_wizard.py +++ b/erpnext/setup/setup_wizard/setup_wizard.py @@ -66,10 +66,6 @@ def setup_complete(args=None): pass -def setup_success(args=None): - company = frappe.db.sql("select name from tabCompany", as_dict=True)[0]["name"] - install_country_fixtures(company) - def create_fiscal_year_and_company(args): if (args.get('fy_start_date')): curr_fiscal_year = get_fy_details(args.get('fy_start_date'), args.get('fy_end_date'))