Merge pull request #32112 from iamejaaz/35370-beta-print-issue

fix: print builder beta print option not working
This commit is contained in:
Ejaaz Khan 2025-04-14 13:13:43 +05:30 committed by GitHub
commit 45ebe74eab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 9 deletions

View file

@ -38,6 +38,9 @@ body {
.col, *[class^="col-"] {
max-width: none !important;
}
.label {
border: none;
}
}
@media screen {

View file

@ -75,15 +75,24 @@ def get_context(context) -> PrintContext:
make_access_log(
doctype=frappe.form_dict.doctype, document=frappe.form_dict.name, file_type="PDF", method="Print"
)
body = get_rendered_template(
doc,
print_format=print_format,
meta=meta,
trigger_print=frappe.form_dict.trigger_print,
no_letterhead=frappe.form_dict.no_letterhead,
letterhead=letterhead,
settings=settings,
)
if print_format and print_format.get("print_format_builder_beta"):
from frappe.utils.weasyprint import get_html
body = get_html(
doctype=frappe.form_dict.doctype, name=frappe.form_dict.name, print_format=print_format.name
)
body += trigger_print_script
else:
body = get_rendered_template(
doc,
print_format=print_format,
meta=meta,
trigger_print=frappe.form_dict.trigger_print,
no_letterhead=frappe.form_dict.no_letterhead,
letterhead=letterhead,
settings=settings,
)
make_access_log(
doctype=frappe.form_dict.doctype, document=frappe.form_dict.name, file_type="PDF", method="Print"