I recently have trouble with picture I want to attach to Items, when I use a weblink:
this is the error message I am getting. Can’t make much if it though. It seems tat when I return the attachment (without clearing the image field) the image kind of remains visible in the Item.
Can anyone point me into the right direction?
Installed Apps
ERPNext: v11.1.71 (version-11)
Frappe Framework: v11.1.63 (version-11)
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
doc.save()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 260, in save
return self._save(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 296, in _save
self.run_before_save_methods()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 876, in run_before_save_methods
self.run_method("validate")
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1048, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 766, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 120, in validate
self.make_thumbnail()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 273, in make_thumbnail
file_doc.make_thumbnail()
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 201, in make_thumbnail
image, filename, extn = get_web_image(self.file_url)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 409, in get_web_image
image = Image.open(StringIO(frappe.safe_decode(r.content)))
TypeError: initial_value must be str or None, not bytes
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 61, in application
response = frappe.handler.handle()
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
data = execute_cmd(cmd)
File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1036, in call
return fn(*args, **newargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
doc.save()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 260, in save
return self._save(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 296, in _save
self.run_before_save_methods()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 876, in run_before_save_methods
self.run_method("validate")
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1048, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 766, in <lambda>
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 120, in validate
self.make_thumbnail()
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/stock/doctype/item/item.py", line 273, in make_thumbnail
file_
doc.make_thumbnail()
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 201, in make_thumbnail
image, filename, extn = get_web_image(self.file_url)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py", line 409, in get_web_image
image = Image.open(StringIO(frappe.safe_decode(r.content)))
TypeError: initial_value must be str or None, not bytes