fix: handle "No Letterhead" in new print format builder (#18990)

[skip ci]
This commit is contained in:
Raffael Meyer 2022-11-24 06:24:46 +01:00 committed by GitHub
parent 8486109f2f
commit 920606f10e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@
import click
import frappe
from frappe import _
@frappe.whitelist()
@ -49,7 +50,11 @@ class PrintFormatGenerator:
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