fix: cannot find attached key file

This commit is contained in:
Saqib Ansari
2020-09-30 14:32:12 +05:30
committed by Saurabh
parent 9d805272be
commit bf2b4bc6f7

View File

@@ -21,6 +21,6 @@ class EInvoiceSettings(Document):
self.public_key = self.read_key_file()
def read_key_file(self):
key_file = frappe.get_doc('File', dict(attached_to_name=self.doctype, attached_to_field='public_key_file'))
key_file = frappe.get_doc('File', dict(attached_to_name=self.doctype))
with open(key_file.get_full_path(), 'rb') as f:
return cstr(f.read())