2
0
mirror of https://github.com/frappe/frappe.git synced 2024-06-12 23:32:23 +00:00

fix: use document language for workflow action (#26138)

This commit is contained in:
Ankush Menat 2024-04-24 13:46:25 +05:30 committed by GitHub
parent 2ec9ef5bf3
commit e5271bc034
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -438,10 +438,26 @@ def get_common_email_args(doc):
subject = _("Workflow Action") + f" on {doctype}: {docname}"
response = get_link_to_form(doctype, docname, f"{doctype}: {docname}")
print_format = doc.meta.default_print_format
lang = doc.get("language") or (
frappe.get_cached_value("Print Format", print_format, "default_print_language")
if print_format
else None
)
return {
"template": "workflow_action",
"header": "Workflow Action",
"attachments": [frappe.attach_print(doctype, docname, file_name=docname, doc=doc)],
"attachments": [
frappe.attach_print(
doctype,
docname,
file_name=docname,
doc=doc,
lang=lang,
print_format=print_format,
)
],
"subject": subject,
"message": response,
}