Merge pull request #6896 from netchampfaris/default-print-lang-notification
fix: Set default print language in Notification
This commit is contained in:
commit
ef23c57106
2 changed files with 11 additions and 3 deletions
|
|
@ -212,8 +212,15 @@ def get_context(context):
|
|||
please enable Allow Print For {0} in Print Settings""".format(status)),
|
||||
title=_("Error in Notification"))
|
||||
else:
|
||||
return [{"print_format_attachment":1, "doctype":doc.doctype, "name": doc.name,
|
||||
"print_format":self.print_format, "print_letterhead": print_settings.with_letterhead}]
|
||||
return [{
|
||||
"print_format_attachment": 1,
|
||||
"doctype": doc.doctype,
|
||||
"name": doc.name,
|
||||
"print_format": self.print_format,
|
||||
"print_letterhead": print_settings.with_letterhead,
|
||||
"lang": frappe.db.get_value('Print Format', self.print_format, 'default_print_language')
|
||||
if self.print_format else 'en'
|
||||
}]
|
||||
|
||||
|
||||
def get_template(self):
|
||||
|
|
|
|||
|
|
@ -175,7 +175,8 @@ def get_email_queue(recipients, sender, subject, **kwargs):
|
|||
if att.get('fid'):
|
||||
_attachments.append(att)
|
||||
elif att.get("print_format_attachment") == 1:
|
||||
att['lang'] = frappe.local.lang
|
||||
if not att.get('lang', None):
|
||||
att['lang'] = frappe.local.lang
|
||||
att['print_letterhead'] = kwargs.get('print_letterhead')
|
||||
_attachments.append(att)
|
||||
e.attachments = json.dumps(_attachments)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue