From 5906f02e3acbba07539cf1f6e8c5f191def983ca Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 2 Jul 2015 17:50:27 +0530 Subject: [PATCH] update item image in invoice if item exists --- erpnext/patches/v5_0/update_item_desc_in_invoice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v5_0/update_item_desc_in_invoice.py b/erpnext/patches/v5_0/update_item_desc_in_invoice.py index 4e2cd26e9d..1f74184a98 100644 --- a/erpnext/patches/v5_0/update_item_desc_in_invoice.py +++ b/erpnext/patches/v5_0/update_item_desc_in_invoice.py @@ -31,7 +31,9 @@ def execute(): desc, image = extract_image_and_description(cstr(d.description)) if not image: - image = item_details.get(d.item_code).image + item_detail = item_details.get(d.item_code) + if item_detail: + image = item_detail.image frappe.db.sql("""update `tab{0}` set description = %s, image = %s where name = %s """.format(dt), (desc, image, d.name))