Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/stock/doctype/purchase_receipt/purchase_receipt.js b/stock/doctype/purchase_receipt/purchase_receipt.js
index d0e58df..8775140 100644
--- a/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -23,24 +23,23 @@
 			
 			this.show_stock_ledger();
 			this.show_general_ledger();
+		} else {
+			cur_frm.add_custom_button(wn._('From Purchase Order'), 
+				function() {
+					wn.model.map_current_doc({
+						method: "buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
+						source_doctype: "Purchase Order",
+						get_query_filters: {
+							supplier: cur_frm.doc.supplier || undefined,
+							docstatus: 1,
+							status: ["!=", "Stopped"],
+							per_received: ["<", 99.99],
+							company: cur_frm.doc.company
+						}
+					})
+				});
 		}
 
-		cur_frm.add_custom_button(wn._('From Purchase Order'), 
-			function() {
-				wn.model.map_current_doc({
-					method: "buying.doctype.purchase_order.purchase_order.make_purchase_receipt",
-					source_doctype: "Purchase Order",
-					get_query_filters: {
-						supplier: cur_frm.doc.supplier || undefined,
-						docstatus: 1,
-						status: ["!=", "Stopped"],
-						per_received: ["<", 99.99],
-						company: cur_frm.doc.company
-					}
-				})
-			});
-
-
 		if(wn.boot.control_panel.country == 'India') {
 			unhide_field(['challan_no', 'challan_date']);
 		}
diff --git a/utilities/make_demo.py b/utilities/make_demo.py
index 2dda953..d1758a0 100644
--- a/utilities/make_demo.py
+++ b/utilities/make_demo.py
@@ -216,7 +216,6 @@
 	st.doc.fiscal_year = "2010"
 	st.doc.expense_adjustment_account = "Stock in Hand - WP"
 	try:
-		st.run_method("get_items")
 		st.insert()
 		webnotes.conn.commit()
 		st.submit()