commit
3a211bf497
1 changed files with 4 additions and 2 deletions
|
|
@ -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"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue