[fix] Item thumbnail
This commit is contained in:
parent
28e3d63280
commit
25956d6282
@ -86,11 +86,16 @@ class Item(WebsiteGenerator):
|
|||||||
self.thumbnail = None
|
self.thumbnail = None
|
||||||
|
|
||||||
if self.website_image and not self.thumbnail:
|
if self.website_image and not self.thumbnail:
|
||||||
file_doc = frappe.get_doc("File", {
|
file_doc = None
|
||||||
"file_url": self.website_image,
|
|
||||||
"attached_to_doctype": "Item",
|
try:
|
||||||
"attached_to_name": self.name
|
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
|
# for CSV import
|
||||||
if not file_doc:
|
if not file_doc:
|
||||||
|
Loading…
Reference in New Issue
Block a user