diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 40bbc2c15fb..09ff5a83fd6 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -97,7 +97,7 @@ class Company(NestedSet): if not frappe.db.get_value("Department", {"company": self.name}): from erpnext.setup.setup_wizard.operations.install_fixtures import install_post_company_fixtures - install_post_company_fixtures(self.name) + install_post_company_fixtures(frappe._dict({'company_name': 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/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py index f4689334f65..66326486fab 100644 --- a/erpnext/setup/setup_wizard/operations/install_fixtures.py +++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py @@ -373,11 +373,15 @@ def install_post_company_fixtures(args=None): {'doctype': 'Department', 'department_name': _('Quality Management'), 'parent_department': _('All Departments'), 'company': args.company_name}, {'doctype': 'Department', 'department_name': _('Research & Development'), 'parent_department': _('All Departments'), 'company': args.company_name}, {'doctype': 'Department', 'department_name': _('Legal'), 'parent_department': _('All Departments'), 'company': args.company_name}, + ] + make_records(records) + +def install_defaults(args=None): + records = [ # Price Lists { "doctype": "Price List", "price_list_name": _("Standard Buying"), "enabled": 1, "buying": 1, "selling": 0, "currency": args.currency }, { "doctype": "Price List", "price_list_name": _("Standard Selling"), "enabled": 1, "buying": 0, "selling": 1, "currency": args.currency }, - ] make_records(records) @@ -478,7 +482,7 @@ def install_post_company_fixtures(args=None): ] # TODO: - # make_records(records, True) + make_records(records, True) def get_fy_details(fy_start_date, fy_end_date): diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py index 3ecd00aacf0..76427615191 100644 --- a/erpnext/setup/setup_wizard/setup_wizard.py +++ b/erpnext/setup/setup_wizard/setup_wizard.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import frappe import json +from time import time from frappe import _ from .operations import install_fixtures as fixtures, taxes_setup, company_setup, sample_data @@ -93,7 +94,7 @@ def setup_complete(args=None): fin(args) def stage_fixtures(args): - fixtures.install(_dict(frappe.local.conf.setup).country) + fixtures.install(args.get('country')) def setup_company(args): fixtures.install_company(args) @@ -140,7 +141,7 @@ def make_setup_docs(args): args.update(config) fixtures.install_company(_dict(args)) - fixtures.install_post_company_fixtures(_dict(args)) + fixtures.install_defaults(_dict(args)) run_post_setup_complete(args) @@ -148,11 +149,3 @@ def make_setup_docs(args): def setup(args, config=None): install_fixtures() make_setup_docs(args) - -def get_fy_details(fy_start_date, fy_end_date): - start_year = getdate(fy_start_date).year - if start_year == getdate(fy_end_date).year: - fy = cstr(start_year) - else: - fy = cstr(start_year) + '-' + cstr(start_year + 1) - return fy