fix: make pdf_generator select field
As per review, renamed chrome_pdf_generator to pdf_generator and made it a select field. - default option available for select is wkhtmltopdf. - default for new print formats is wkhtmltopdf. - print designer on install adds a new option ( chrome ) to the select field. - added patch to update existing print format to wkhtmltopdf.
This commit is contained in:
parent
fc213ed761
commit
e818ef22f7
4 changed files with 15 additions and 7 deletions
|
|
@ -242,3 +242,4 @@ execute:frappe.db.set_single_value("Workspace Settings", "workspace_setup_comple
|
|||
frappe.patches.v16_0.add_app_launcher_in_navbar_settings
|
||||
frappe.desk.doctype.workspace.patches.update_app
|
||||
frappe.patches.v16_0.move_role_desk_settings_to_user
|
||||
frappe.printing.doctype.print_format.patches.sets_wkhtmltopdf_as_default_for_pdf_generator_field
|
||||
|
|
|
|||
0
frappe/printing/doctype/print_format/patches/__init__.py
Normal file
0
frappe/printing/doctype/print_format/patches/__init__.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
"""sets "wkhtmltopdf" as default for pdf_generator field"""
|
||||
for pf in frappe.get_all("Print Format", pluck="name"):
|
||||
frappe.db.set_value("Print Format", pf, "pdf_generator", "wkhtmltopdf")
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
"standard",
|
||||
"custom_format",
|
||||
"disabled",
|
||||
"chrome_pdf_generator",
|
||||
"pdf_generator",
|
||||
"section_break_6",
|
||||
"print_format_type",
|
||||
"raw_printing",
|
||||
|
|
@ -258,17 +258,17 @@
|
|||
"options": "Hide\nTop Left\nTop Center\nTop Right\nBottom Left\nBottom Center\nBottom Right"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"description": "<a href=\"https://github.com/frappe/print_designer/\">Print Designer</a> should be installed to use Chrome.",
|
||||
"fieldname": "chrome_pdf_generator",
|
||||
"fieldtype": "Check",
|
||||
"label": "Use Chrome PDF Generator"
|
||||
"default": "wkhtmltopdf",
|
||||
"fieldname": "pdf_generator",
|
||||
"fieldtype": "Select",
|
||||
"label": "PDF Generator",
|
||||
"options": "wkhtmltopdf"
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-print",
|
||||
"idx": 1,
|
||||
"links": [],
|
||||
"modified": "2025-02-13 18:39:24.319650",
|
||||
"modified": "2025-02-14 14:49:39.181074",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Printing",
|
||||
"name": "Print Format",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue