[Fix] Throw error if item is added multiple time
diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
index d8c9b04..dffe72e 100644
--- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
@@ -19,6 +19,7 @@
 class TestPurchaseInvoice(unittest.TestCase):
 	def setUp(self):
 		unlink_payment_on_cancel_of_invoice()
+		frappe.db.set_value("Buying Settings", None, "allow_multiple_items", 1)
 
 	def tearDown(self):
 		unlink_payment_on_cancel_of_invoice(0)
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py
index 8435f3b..79820fa 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.py
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.py
@@ -72,8 +72,7 @@
 
 		if items and len(items) != len(set(items)) and \
 			not cint(frappe.db.get_single_value("Buying Settings", "allow_multiple_items") or 0):
-			frappe.msgprint(_("Warning: Same item has been entered multiple times."), alert=True)
-
+			frappe.throw(_("Same item cannot be entered multiple times."))
 
 	def check_for_closed_status(self, doctype, docname):
 		status = frappe.db.get_value(doctype, docname, "status")
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
index d4a0d07..17786aa 100644
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
@@ -112,6 +112,7 @@
 		self.assertEquals(get_ordered_qty(item_code="_Test Item", warehouse="_Test Warehouse - _TC"), existing_ordered_qty)
 		
 	def test_group_same_items(self):
+		frappe.db.set_value("Buying Settings", None, "allow_multiple_items", 1)
 		frappe.get_doc({
 			"doctype": "Purchase Order",
 			"company": "_Test Company",
@@ -121,10 +122,10 @@
 			"conversion_factor" : 1,
 			"items" : get_same_items(),
 			"group_same_items": 1
-		}).insert()
+			}).insert(ignore_permissions=True)
 
 		
-def get_same_items():	
+def get_same_items():
 	return [
 				{
 					"item_code": "_Test FG Item",
diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
index 7421e01..c4c6fa1 100644
--- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@@ -11,6 +11,9 @@
 from erpnext import set_perpetual_inventory
 
 class TestPurchaseReceipt(unittest.TestCase):
+	def setUp(self):
+		frappe.db.set_value("Buying Settings", None, "allow_multiple_items", 1)
+
 	def test_make_purchase_invoice(self):
 		pr = make_purchase_receipt(do_not_save=True)
 		self.assertRaises(frappe.ValidationError, make_purchase_invoice, pr.name)
diff --git a/erpnext/stock/doctype/purchase_receipt/test_records.json b/erpnext/stock/doctype/purchase_receipt/test_records.json
index 62c6cc3..315e06a 100644
--- a/erpnext/stock/doctype/purchase_receipt/test_records.json
+++ b/erpnext/stock/doctype/purchase_receipt/test_records.json
@@ -50,10 +50,10 @@
    {
     "base_amount": 250.0,
     "conversion_factor": 1.0,
-    "description": "_Test Item",
+    "description": "_Test FG Item",
     "doctype": "Purchase Receipt Item",
-    "item_code": "_Test Item",
-    "item_name": "_Test Item",
+    "item_code": "_Test FG Item",
+    "item_name": "_Test FG Item",
     "parentfield": "items",
     "qty": 5.0,
     "rate": 50.0,