fix: Replace file_manager api with file doc api
This commit is contained in:
parent
7b7a492380
commit
cfa2e7613f
1 changed files with 2 additions and 2 deletions
|
|
@ -15,7 +15,6 @@ import frappe.desk.reportview
|
|||
from frappe.permissions import get_role_permissions
|
||||
from six import string_types, iteritems
|
||||
from datetime import timedelta
|
||||
from frappe.utils.file_manager import get_file
|
||||
from frappe.utils import gzip_decompress
|
||||
|
||||
def get_report_doc(report_name):
|
||||
|
|
@ -195,7 +194,8 @@ def get_prepared_report_result(report, filters, dn="", user=None):
|
|||
|
||||
# Prepared Report data is stored in a GZip compressed JSON file
|
||||
attached_file_name = frappe.db.get_value("File", {"attached_to_doctype": doc.doctype, "attached_to_name":doc.name}, "name")
|
||||
compressed_content = get_file(attached_file_name)[1]
|
||||
attached_file = frappe.get_doc('File', attached_file_name)
|
||||
compressed_content = attached_file.get_content()
|
||||
uncompressed_content = gzip_decompress(compressed_content)
|
||||
data = json.loads(uncompressed_content)
|
||||
if data:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue