fix patch

This commit is contained in:
joezsweet 2018-01-10 23:11:13 +01:00 committed by GitHub
parent c95675c074
commit 9116666288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()