From 20c9af556f6a420198fb44f02f4242f7c2b2fdce Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sun, 19 Sep 2021 21:23:03 +0530 Subject: [PATCH] fix(Workflow Action): Pass doc to attach_print to avoid "Not Found" - Printview used to go empty for new document due to "Not Found" error in printview because that new document has not been saved in the database while processing workflow action email. --- frappe/workflow/doctype/workflow_action/workflow_action.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/workflow/doctype/workflow_action/workflow_action.py b/frappe/workflow/doctype/workflow_action/workflow_action.py index a04e9356cd..056eb0b5db 100644 --- a/frappe/workflow/doctype/workflow_action/workflow_action.py +++ b/frappe/workflow/doctype/workflow_action/workflow_action.py @@ -292,7 +292,7 @@ def get_common_email_args(doc): common_args = { 'template': 'workflow_action', 'header': 'Workflow Action', - 'attachments': [frappe.attach_print(doctype, docname , file_name=docname)], + 'attachments': [frappe.attach_print(doctype, docname, file_name=docname, doc=doc)], 'subject': subject, 'message': response }