From 4e383ed32e98c42fe663f52a8543a283d90aaa86 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 13 Mar 2018 18:11:46 +0530 Subject: [PATCH] [Fix] Letterhead did not show up on email alert attachment (#5192) --- frappe/core/doctype/communication/email.py | 2 +- frappe/email/doctype/email_alert/email_alert.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frappe/core/doctype/communication/email.py b/frappe/core/doctype/communication/email.py index c6d0e9fcb1..00b9918933 100755 --- a/frappe/core/doctype/communication/email.py +++ b/frappe/core/doctype/communication/email.py @@ -175,7 +175,7 @@ def _notify(doc, print_html=None, print_format=None, attachments=None, communication=doc.name, read_receipt=doc.read_receipt, is_notification=True if doc.sent_or_received =="Received" else False, - print_letterhead=True if frappe.flags.print_letterhead=='true' else False + print_letterhead=frappe.flags.print_letterhead ) def update_parent_mins_to_first_response(doc): diff --git a/frappe/email/doctype/email_alert/email_alert.py b/frappe/email/doctype/email_alert/email_alert.py index a90dbb53da..1f30e58cbf 100755 --- a/frappe/email/doctype/email_alert/email_alert.py +++ b/frappe/email/doctype/email_alert/email_alert.py @@ -122,7 +122,7 @@ def get_context(context): title=_("Error in Email Alert")) else: return [{"print_format_attachment":1, "doctype":doc.doctype, "name": doc.name, - "print_format":self.print_format}] + "print_format":self.print_format, "print_letterhead": print_settings.with_letterhead}] context = get_context(doc) recipients = [] @@ -172,7 +172,9 @@ def get_context(context): message= frappe.render_template(self.message, context), reference_doctype = doc.doctype, reference_name = doc.name, - attachments = attachments) + attachments = attachments, + print_letterhead = ((attachments + and attachments[0].get('print_letterhead')) or False)) if self.set_property_after_alert: frappe.db.set_value(doc.doctype, doc.name, self.set_property_after_alert,