Fixes Item Price duplicate entry validation

This commit is contained in:
Anand Doshi 2014-04-17 11:40:22 +05:30
parent de1a97d506
commit 0d345c9152

View File

@ -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 = \