[fix] [minor] erpnext demo
diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.py b/accounts/doctype/purchase_invoice/purchase_invoice.py
index bfea0bb..0538323 100644
--- a/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -261,13 +261,11 @@
 			if d.purchase_order:
 				submitted = sql("select name from `tabPurchase Order` where docstatus = 1 and name = '%s'" % d.purchase_order)
 				if not submitted:
-					msgprint("Purchase Order : "+ cstr(d.purchase_order) +" is not submitted")
-					raise Exception , "Validation Error."
+					webnotes.throw("Purchase Order : "+ cstr(d.purchase_order) +" is not submitted")
 			if d.purchase_receipt:
 				submitted = sql("select name from `tabPurchase Receipt` where docstatus = 1 and name = '%s'" % d.purchase_receipt)
 				if not submitted:
-					msgprint("Purchase Receipt : "+ cstr(d.purchase_receipt) +" is not submitted")
-					raise Exception , "Validation Error."
+					webnotes.throw("Purchase Receipt : "+ cstr(d.purchase_receipt) +" is not submitted")
 					
 					
 	def update_against_document_in_jv(self):
diff --git a/utilities/demo/make_demo.py b/utilities/demo/make_demo.py
index fc07767..7600b2b 100644
--- a/utilities/demo/make_demo.py
+++ b/utilities/demo/make_demo.py
@@ -266,11 +266,11 @@
 	from stock.stock_ledger import NegativeStockError
 	from stock.doctype.stock_entry.stock_entry import IncorrectValuationRateError, DuplicateEntryForProductionOrderError
 
-	st = webnotes.bean(make_stock_entry(pro_id, purpose))
-	st.doc.posting_date = current_date
-	st.doc.fiscal_year = "2013"
-	st.doc.expense_adjustment_account = "Stock in Hand - WP"
 	try:
+		st = webnotes.bean(make_stock_entry(pro_id, purpose))
+		st.doc.posting_date = current_date
+		st.doc.fiscal_year = "2013"
+		st.doc.expense_adjustment_account = "Stock in Hand - WP"
 		st.insert()
 		webnotes.conn.commit()
 		st.submit()
@@ -278,7 +278,7 @@
 	except NegativeStockError: pass
 	except IncorrectValuationRateError: pass
 	except DuplicateEntryForProductionOrderError: pass
-
+	
 def make_quotation(current_date):
 	b = webnotes.bean([{
 		"creation": current_date,
diff --git a/utilities/demo/make_erpnext_demo.py b/utilities/demo/make_erpnext_demo.py
index 0a8a935..b6c22c2 100644
--- a/utilities/demo/make_erpnext_demo.py
+++ b/utilities/demo/make_erpnext_demo.py
@@ -73,7 +73,7 @@
 		s.doc.script = dfile.read()
 
 if __name__=="__main__":
-	webnotes.connect()
+	# webnotes.connect()
 	webnotes.mute_emails = 1
 	make_demo_app()
 	make_demo_user()