mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 06:59:20 +00:00
Consider description also to check item duplication in purchase cycle
This commit is contained in:
@@ -248,7 +248,7 @@ class DocType(TransactionBase):
|
|||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
# list criteria that should not repeat if item is stock item
|
# list criteria that should not repeat if item is stock item
|
||||||
e = [d.schedule_date, d.item_code, d.warehouse, d.uom, d.fields.has_key('prevdoc_docname') and d.prevdoc_docname or '', d.fields.has_key('prevdoc_detail_docname') and d.prevdoc_detail_docname or '', d.fields.has_key('batch_no') and d.batch_no or '']
|
e = [d.schedule_date, d.item_code, d.description, d.warehouse, d.uom, d.fields.has_key('prevdoc_docname') and d.prevdoc_docname or '', d.fields.has_key('prevdoc_detail_docname') and d.prevdoc_detail_docname or '', d.fields.has_key('batch_no') and d.batch_no or '']
|
||||||
|
|
||||||
# if is not stock item
|
# if is not stock item
|
||||||
f = [d.schedule_date, d.item_code, d.description]
|
f = [d.schedule_date, d.item_code, d.description]
|
||||||
@@ -258,16 +258,16 @@ class DocType(TransactionBase):
|
|||||||
if ch and ch[0][0] == 'Yes':
|
if ch and ch[0][0] == 'Yes':
|
||||||
# check for same items
|
# check for same items
|
||||||
if e in check_list:
|
if e in check_list:
|
||||||
msgprint("Item %s has been entered more than once with same schedule date, warehouse and uom." % d.item_code)
|
msgprint("""Item %s has been entered more than once with same description, schedule date, warehouse and uom.\n
|
||||||
raise Exception
|
Please change any of the field value to enter the item twice""" % d.item_code, raise_exception = 1)
|
||||||
else:
|
else:
|
||||||
check_list.append(e)
|
check_list.append(e)
|
||||||
|
|
||||||
elif ch and ch[0][0] == 'No':
|
elif ch and ch[0][0] == 'No':
|
||||||
# check for same items
|
# check for same items
|
||||||
if f in chk_dupl_itm:
|
if f in chk_dupl_itm:
|
||||||
msgprint("Item %s has been entered more than once." % d.item_code)
|
msgprint("""Item %s has been entered more than once with same description, schedule date.\n
|
||||||
raise Exception
|
Please change any of the field value to enter the item twice.""" % d.item_code, raise_exception = 1)
|
||||||
else:
|
else:
|
||||||
chk_dupl_itm.append(f)
|
chk_dupl_itm.append(f)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user