update item image in invoice if item exists

This commit is contained in:
Nabin Hait 2015-07-02 17:50:27 +05:30
parent 721dcb1870
commit 5906f02e3a

View File

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