From 25956d62820710362a34ede196bb70fa53bdf7aa Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 20 Oct 2015 08:12:07 +0530 Subject: [PATCH] [fix] Item thumbnail --- erpnext/stock/doctype/item/item.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index faae960343..65a4b91d36 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -86,11 +86,16 @@ class Item(WebsiteGenerator): self.thumbnail = None if self.website_image and not self.thumbnail: - file_doc = frappe.get_doc("File", { - "file_url": self.website_image, - "attached_to_doctype": "Item", - "attached_to_name": self.name - }) + file_doc = None + + try: + file_doc = frappe.get_doc("File", { + "file_url": self.website_image, + "attached_to_doctype": "Item", + "attached_to_name": self.name + }) + except frappe.DoesNotExistError: + pass # for CSV import if not file_doc: