Skip to content

Commit

Permalink
fix: use document language for workflow action (#26138) (#26139)
Browse files Browse the repository at this point in the history
(cherry picked from commit e5271bc)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Apr 24, 2024
1 parent 3fc7071 commit 876d230
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion frappe/workflow/doctype/workflow_action/workflow_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,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,
}
Expand Down

0 comments on commit 876d230

Please sign in to comment.