From 49a59c075f76ada8e62aea029bfc885a55cea1b9 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 28 Jul 2015 12:23:20 +0530 Subject: [PATCH] [minor] [setup-wizard] add check for sample data --- erpnext/setup/page/setup_wizard/setup_wizard.js | 10 +++++++--- erpnext/setup/page/setup_wizard/setup_wizard.py | 9 +++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.js b/erpnext/setup/page/setup_wizard/setup_wizard.js index b38bd1c373..ac720c97d5 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.js +++ b/erpnext/setup/page/setup_wizard/setup_wizard.js @@ -29,7 +29,7 @@ frappe.pages['setup-wizard'].on_page_load = function(wrapper) { erpnext.wiz.taxes.slide, erpnext.wiz.customers.slide, erpnext.wiz.suppliers.slide, - erpnext.wiz.items.slide, + erpnext.wiz.items.slide ] } @@ -406,7 +406,6 @@ $.extend(erpnext.wiz, { description: __('Your financial year begins on'), reqd:1}, {fieldname:'fy_end_date', label:__('Financial Year End Date'), fieldtype:'Date', description: __('Your financial year ends on'), reqd:1}, - ], help: __('The name of your company for which you are setting up this system.'), @@ -510,7 +509,7 @@ $.extend(erpnext.wiz, { slide: { icon: "icon-money", "title": __("Add Users"), - "help": __("Add users to your organization"), + "help": __("Add users to your organization, other than yourself"), "fields": [], before_load: function(slide) { slide.fields = []; @@ -635,6 +634,11 @@ $.extend(erpnext.wiz, { ]) } slide.fields[1].reqd = 1; + + // dummy data + slide.fields.push({fieldtype: "Section Break"}); + slide.fields.push({fieldtype: "Check", fieldname: "add_sample_data", + label: __("Add a few sample records"), "default": 1}); }, css_class: "two-column" }, diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index 812a9f12b7..e8c769974b 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -86,10 +86,11 @@ def setup_account(args=None): frappe.clear_cache() - try: - make_sample_data() - except FiscalYearError: - pass + if args.get("add_sample_data"): + try: + make_sample_data() + except FiscalYearError: + pass except: if args: traceback = frappe.get_traceback()