Skip to content

Commit

Permalink
fix: handle "No Letterhead" in new print format builder (#18990) (#18992
Browse files Browse the repository at this point in the history
)

[skip ci]

(cherry picked from commit 920606f)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
  • Loading branch information
mergify[bot] and barredterra committed Nov 24, 2022
1 parent 87a0cf7 commit 1ad1cab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frappe/utils/weasyprint.py
Expand Up @@ -4,6 +4,7 @@
import click

import frappe
from frappe import _


@frappe.whitelist()
Expand Down Expand Up @@ -49,7 +50,11 @@ def __init__(self, print_format, doc, letterhead=None):
self.base_url = frappe.utils.get_url()
self.print_format = frappe.get_doc("Print Format", print_format)
self.doc = doc

if letterhead == _("No Letterhead"):
letterhead = None
self.letterhead = frappe.get_doc("Letter Head", letterhead) if letterhead else None

self.build_context()
self.layout = self.get_layout(self.print_format)
self.context.layout = self.layout
Expand Down

0 comments on commit 1ad1cab

Please sign in to comment.