diff --git a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py index c939dd5d33..a2e25795eb 100644 --- a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py +++ b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py @@ -16,11 +16,14 @@ def execute(): barcode = item.barcode.strip() if barcode and '<' not in barcode: - frappe.get_doc({ - 'idx': 0, - 'doctype': 'Item Barcode', - 'barcode': barcode, - 'parenttype': 'Item', - 'parent': item.name, - 'parentfield': 'barcodes' - }).insert() + try: + frappe.get_doc({ + 'idx': 0, + 'doctype': 'Item Barcode', + 'barcode': barcode, + 'parenttype': 'Item', + 'parent': item.name, + 'parentfield': 'barcodes' + }).insert() + except frappe.DuplicateEntryError: + continue