From 0d345c9152ea3e6e622dd1b1cd15df0b9e6f5e2b Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 17 Apr 2014 11:40:22 +0530 Subject: [PATCH] Fixes Item Price duplicate entry validation --- erpnext/stock/doctype/item_price/item_price.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/item_price/item_price.py b/erpnext/stock/doctype/item_price/item_price.py index 56b3632124..4747af8393 100644 --- a/erpnext/stock/doctype/item_price/item_price.py +++ b/erpnext/stock/doctype/item_price/item_price.py @@ -29,9 +29,10 @@ class ItemPrice(Document): def check_duplicate_item(self): if frappe.db.sql("""select name from `tabItem Price` - where item_code=%s and price_list=%s and name!=%s""", - (self.item_code, self.price_list, self.name)): - frappe.throw(_("Item {0} appears multiple times in Price List {1}").format(self.item_code, self.price_list)) + where item_code=%s and price_list=%s and name!=%s""", (self.item_code, self.price_list, self.name)): + + frappe.throw(_("Item {0} appears multiple times in Price List {1}").format(self.item_code, self.price_list), + ItemPriceDuplicateItem) def update_price_list_details(self): self.buying, self.selling, self.currency = \