From b7678c8d398bf50622f703d298f3891735365b07 Mon Sep 17 00:00:00 2001 From: Shllokkk <140623894+Shllokkk@users.noreply.github.com> Date: Tue, 17 Feb 2026 11:52:37 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20inconsistent=20mandatory=20constraint=20?= =?UTF-8?q?on=20html=20field=20during=20creation=20=E2=80=A6=20(#36893)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: inconsistent mandatory constraint on html field during creation of a new print format * fix: add mandatory_depends_on for the raw commands field --- frappe/printing/doctype/print_format/print_format.js | 2 -- frappe/printing/doctype/print_format/print_format.json | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/printing/doctype/print_format/print_format.js b/frappe/printing/doctype/print_format/print_format.js index 3d2397c111..1b15d44f15 100644 --- a/frappe/printing/doctype/print_format/print_format.js +++ b/frappe/printing/doctype/print_format/print_format.js @@ -37,8 +37,6 @@ frappe.ui.form.on("Print Format", { frappe.set_route("print-format-builder", frm.doc.name); } }); - } else if (frm.doc.custom_format && !frm.doc.raw_printing) { - frm.set_df_property("html", "reqd", 1); } if (frappe.model.can_write("Customize Form")) { frappe.model.with_doctype(frm.doc.doc_type, function () { diff --git a/frappe/printing/doctype/print_format/print_format.json b/frappe/printing/doctype/print_format/print_format.json index 2a7b3c0215..fa4b9313d3 100644 --- a/frappe/printing/doctype/print_format/print_format.json +++ b/frappe/printing/doctype/print_format/print_format.json @@ -117,6 +117,7 @@ "fieldname": "html", "fieldtype": "Code", "label": "HTML", + "mandatory_depends_on": "eval: doc.custom_format", "oldfieldname": "html", "oldfieldtype": "Text Editor", "options": "Jinja" @@ -127,6 +128,7 @@ "fieldname": "raw_commands", "fieldtype": "Code", "label": "Raw Commands", + "mandatory_depends_on": "raw_printing", "options": "Jinja" }, { @@ -292,7 +294,7 @@ "icon": "fa fa-print", "idx": 1, "links": [], - "modified": "2025-09-23 10:39:51.123539", + "modified": "2026-02-11 13:17:55.662780", "modified_by": "Administrator", "module": "Printing", "name": "Print Format",