Merge pull request #1969 from frappe/hotfix

Hotfix
This commit is contained in:
Rushabh Mehta 2016-08-12 11:39:20 +05:30 committed by GitHub
commit 3a211bf497

View file

@ -18,8 +18,10 @@ def read_csv_content_from_uploaded_file(ignore_encoding=False):
return read_csv_content(fcontent, ignore_encoding)
def read_csv_content_from_attached_file(doc):
fileid = frappe.db.get_value("File", {"attached_to_doctype": doc.doctype,
"attached_to_name":doc.name}, "name")
fileid = frappe.get_all("File", fields = ["name"], filters = {"attached_to_doctype": doc.doctype,
"attached_to_name":doc.name}, order_by="creation desc")
if fileid : fileid = fileid[0].name
if not fileid:
msgprint(_("File not attached"))