From 91166662887aaa5c13002137dffdd803631f145f Mon Sep 17 00:00:00 2001 From: joezsweet Date: Wed, 10 Jan 2018 23:11:13 +0100 Subject: [PATCH] fix patch --- erpnext/patches/v10_0/item_barcode_childtable_migrate.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py index d36012ddd1..4194c873e6 100644 --- a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py +++ b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py @@ -10,6 +10,7 @@ def execute(): items_barcode = frappe.db.sql("SELECT name, barcode FROM tabItem WHERE barcode IS NOT NULL", as_dict=1) for item in items_barcode: - doc = frappe.get_doc("Item", item.name) - doc.append("barcodes", {"barcode": item.get("barcode")}) - doc.save() + doc = frappe.get_doc("Item", item.get("name")) + if item.get("barcode"): + doc.append("barcodes", {"barcode": item.get("barcode")}) + doc.save()