diff --git a/utilities/demo/make_demo.py b/utilities/demo/make_demo.py index 6f18f76f9a..4383d32129 100644 --- a/utilities/demo/make_demo.py +++ b/utilities/demo/make_demo.py @@ -30,7 +30,6 @@ prob = { } def make(reset=False, simulate=True): - webnotes.connect() #webnotes.print_messages = True webnotes.mute_emails = True webnotes.rollback_on_exception = True @@ -38,7 +37,7 @@ def make(reset=False, simulate=True): if reset: setup() if simulate: - simulate() + _simulate() def setup(): install() @@ -50,7 +49,7 @@ def setup(): # make_opening_stock() # make_opening_accounts() -def simulate(): +def _simulate(): global runs_for current_date = webnotes.utils.getdate(start_date) @@ -411,7 +410,4 @@ def import_data(dt, submit=False): if submit: webnotes.form_dict["params"] = json.dumps({"_submit": 1}) webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", doctype+".csv") - upload() - -if __name__=="__main__": - make() \ No newline at end of file + upload() \ No newline at end of file diff --git a/utilities/demo/make_erpnext_demo.py b/utilities/demo/make_erpnext_demo.py index db1d25bd82..9e56839fb8 100644 --- a/utilities/demo/make_erpnext_demo.py +++ b/utilities/demo/make_erpnext_demo.py @@ -6,7 +6,14 @@ import webnotes, os import utilities.demo.make_demo def make_demo_app(): - + webnotes.mute_emails = 1 + webnotes.connect() + utilities.demo.make_demo.make(reset=True, simulate=False) + # setup demo user etc so that the site it up faster, while the data loads + make_demo_user() + make_demo_login_page() + make_demo_on_login_script() + utilities.demo.make_demo.make(reset=False, simulate=True) def make_demo_user(): roles = ["Accounts Manager", "Analytics", "Expense Approver", "Accounts User", @@ -111,11 +118,4 @@ def make_demo_on_login_script(): webnotes.conn.commit() if __name__=="__main__": - # webnotes.connect() - webnotes.mute_emails = 1 - utilities.demo.make_demo.make(reset=True, simulate=False) - # setup demo user etc so that the site it up faster, while the data loads - make_demo_user() - make_demo_login_page() - make_demo_on_login_script() - utilities.demo.make_demo.make(reset=False, simulate=True) \ No newline at end of file + make_demo_app() \ No newline at end of file