Fixes Item Price duplicate entry validation
This commit is contained in:
parent
de1a97d506
commit
0d345c9152
@ -29,9 +29,10 @@ class ItemPrice(Document):
|
|||||||
|
|
||||||
def check_duplicate_item(self):
|
def check_duplicate_item(self):
|
||||||
if frappe.db.sql("""select name from `tabItem Price`
|
if frappe.db.sql("""select name from `tabItem Price`
|
||||||
where item_code=%s and price_list=%s and name!=%s""",
|
where item_code=%s and price_list=%s and name!=%s""", (self.item_code, self.price_list, self.name)):
|
||||||
(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))
|
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):
|
def update_price_list_details(self):
|
||||||
self.buying, self.selling, self.currency = \
|
self.buying, self.selling, self.currency = \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user