blob: a55dc80009220e6277baf644124ebb0c963e0653 [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()
Rushabh Mehta2b76a5e2013-08-02 15:16:59 +05307 webnotes.print_messages = True
Rushabh Mehtaed186b72013-07-30 16:19:40 +05308 webnotes.mute_emails = True
9 install()
10 complete_setup()
11 make_items()
12 make_customers_suppliers_contacts()
13 # make_bom()
14 # make_opening_stock()
15 # make_opening_accounts()
16
17def install():
18 print "Creating Fresh Database..."
19 from webnotes.install_lib.install import Installer
20 inst = Installer('root')
21 inst.import_from_db("demo", verbose = 1)
22
23def complete_setup():
24 print "Complete Setup..."
25 webnotes.get_obj("Setup Control").setup_account({
26 "first_name": "Test",
27 "last_name": "User",
28 "fy_start": "1st Jan",
29 "industry": "Manufacturing",
30 "company_name": "Wind Power LLC",
31 "company_abbr": "WP",
32 "currency": "INR",
33 "timezone": "America/New York",
34 "country": "United States"
35 })
36
37def make_items():
38 print "Importing Items..."
39 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Item.csv")
40 upload()
Rushabh Mehta2b76a5e2013-08-02 15:16:59 +053041 print "Importing Item Prices..."
42 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Item_Price.csv")
43 upload()
Rushabh Mehtaed186b72013-07-30 16:19:40 +053044
45def make_customers_suppliers_contacts():
46 print "Importing Customers..."
47 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Customer.csv")
48 upload()
49 print "Importing Suppliers..."
50 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Supplier.csv")
51 upload()
52 print "Importing Contacts..."
53 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Contact.csv")
54 upload()
55 print "Importing Address..."
56 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Address.csv")
57 upload()
58 print "Importing Lead..."
59 webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Lead.csv")
60 upload()
61
62
63if __name__=="__main__":
64 make()