Ignore duplicate entry

This commit is contained in:
Suraj Shetty 2019-02-16 21:09:24 +05:30
parent 1399fbe986
commit 3a2f342ac1

View File

@ -16,11 +16,14 @@ def execute():
barcode = item.barcode.strip() barcode = item.barcode.strip()
if barcode and '<' not in barcode: if barcode and '<' not in barcode:
frappe.get_doc({ try:
'idx': 0, frappe.get_doc({
'doctype': 'Item Barcode', 'idx': 0,
'barcode': barcode, 'doctype': 'Item Barcode',
'parenttype': 'Item', 'barcode': barcode,
'parent': item.name, 'parenttype': 'Item',
'parentfield': 'barcodes' 'parent': item.name,
}).insert() 'parentfield': 'barcodes'
}).insert()
except frappe.DuplicateEntryError:
continue