feat: redirect to print format doc when type is jinja

This commit is contained in:
khushi8112 2025-10-15 12:30:35 +05:30
parent 1af85a390a
commit 4b20d236f5

View file

@ -259,10 +259,18 @@ frappe.ui.form.PrintView = class {
print_format.name &&
(print_format.print_format_builder || print_format.print_format_builder_beta) &&
print_format.standard === "No";
let is_standard_but_editable = print_format.name && print_format.custom_format;
if (is_standard_but_editable) {
frappe.set_route("Form", "Print Format", print_format.name);
let is_standard_jinja_custom =
print_format.standard === "Yes" &&
print_format.custom_format &&
print_format.print_format_type === "Jinja";
if (is_standard_jinja_custom) {
let doc = frappe.get_doc("Print Format", print_format.name);
frappe.model.with_doctype("Print Format", () => {
let newdoc = frappe.model.copy_doc(doc);
frappe.set_route("Form", "Print Format", newdoc.name);
});
return;
}
if (is_custom_format) {