[multicheck] Select multiple domains in setup (#11709)

* [multicheck] select multiple domains in setup

* use multiple domains in make_sample_data

* revert to setting in domains child table

* domains slide validation

* update setup wizard test
This commit is contained in:
Prateeksha Singh
2017-12-06 13:28:06 +05:30
committed by Nabin Hait
parent cd477fc187
commit 7351709980
6 changed files with 28 additions and 27 deletions

View File

@@ -8,7 +8,7 @@
"currency": "INR",
"customer_1": "Test Customer 1",
"customer_2": "Test Customer 2",
"domain": "Manufacturing",
"domains": ["Manufacturing"],
"email": "great@example.com",
"full_name": "Great Tester",
"fy_end_date": "2018-03-31",

View File

@@ -10,7 +10,7 @@ import random, os, json
from frappe import _
from markdown2 import markdown
def make_sample_data(domain, make_dependent = False):
def make_sample_data(domains, make_dependent = False):
"""Create a few opportunities, quotes, material requests, issues, todos, projects
to help the user get started"""
@@ -28,7 +28,7 @@ def make_sample_data(domain, make_dependent = False):
if items and warehouses:
make_material_request(frappe.get_all("Item"))
make_projects(domain)
make_projects(domains)
import_email_alert()
frappe.db.commit()
@@ -89,7 +89,7 @@ def make_material_request(items):
def make_issue():
pass
def make_projects(domain):
def make_projects(domains):
current_date = frappe.utils.nowdate()
project = frappe.get_doc({
"doctype": "Project",
@@ -104,7 +104,7 @@ def make_projects(domain):
"file": "explore.md"
}]
if domain == 'Education':
if 'Education' in domains:
tasks += [
{
"title": _("Setup your Institute in ERPNext"),

View File

@@ -39,8 +39,10 @@ def setup_complete(args=None):
create_logo(args)
frappe.local.message_log = []
domains = args.get('domains')
domain_settings = frappe.get_single('Domain Settings')
domain_settings.set_active_domains([args.get('domain')])
domain_settings.set_active_domains(domains)
frappe.db.commit()
login_as_first_user(args)
@@ -49,7 +51,7 @@ def setup_complete(args=None):
frappe.clear_cache()
try:
make_sample_data(args.get('domain'))
make_sample_data(domains)
frappe.clear_cache()
except:
# clear message
@@ -80,7 +82,7 @@ def create_fiscal_year_and_company(args):
'country': args.get('country'),
'create_chart_of_accounts_based_on': 'Standard Template',
'chart_of_accounts': args.get('chart_of_accounts'),
'domain': args.get('domain')
'domain': args.get('domains')[0]
}).insert()
#Enable shopping cart

View File

@@ -40,8 +40,7 @@ def run_setup_wizard_test():
time.sleep(1)
# domain slide
# time.sleep(3)
driver.set_select("domain", "Manufacturing")
driver.set_multicheck("domains", ["Manufacturing"])
time.sleep(1)
driver.click(".next-btn")