blob: 8328853a7c945ca6cd5bd5faf0fe9f67ab12704e [file] [log] [blame]
Rushabh Mehtaed186b72013-07-30 16:19:40 +05301import webnotes, os
2webnotes.session = webnotes._dict({"user":"Administrator"})
3from core.page.data_import_tool.data_import_tool import upload
4
5def make():
6 webnotes.connect()
7 webnotes.mute_emails = True
8 install()
9 complete_setup()
10 make_items()
11 make_customers_suppliers_contacts()
12 # make_bom()
13 # make_opening_stock()
14 # make_opening_accounts()
15
16def install():
17 print "Creating Fresh Database..."
18 from webnotes.install_lib.install import Installer
19 inst = Installer('root')
20 inst.import_from_db("demo", verbose = 1)
21
22def complete_setup():
23 print "Complete Setup..."
24 webnotes.get_obj("Setup Control").setup_account({
25 "first_name": "Test",
26 "last_name": "User",
27 "fy_start": "1st Jan",
28 "industry": "Manufacturing",
29 "company_name": "Wind Power LLC",
30 "company_abbr": "WP",
31 "currency": "INR",
32 "timezone": "America/New York",
33 "country": "United States"
34 })
35
36def make_items():
37 print "Importing Items..."
38 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Item.csv")
39 upload()
40
41def make_customers_suppliers_contacts():
42 print "Importing Customers..."
43 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Customer.csv")
44 upload()
45 print "Importing Suppliers..."
46 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Supplier.csv")
47 upload()
48 print "Importing Contacts..."
49 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Contact.csv")
50 upload()
51 print "Importing Address..."
52 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Address.csv")
53 upload()
54 print "Importing Lead..."
55 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Lead.csv")
56 upload()
57
58
59if __name__=="__main__":
60 make()