diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json index 012fb1be6d4..1e410ea93ad 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json @@ -10,6 +10,7 @@ "field_order": [ "settings", "has_print_format", + "print_format_creation", "primary_settings", "bank_name", "cheque_size", @@ -61,6 +62,17 @@ "hidden": 1, "label": "Has Print Format", "no_copy": 1, + "permlevel": 1, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "print_format_creation", + "fieldtype": "Datetime", + "hidden": 1, + "label": "Print Format Creation", + "no_copy": 1, + "permlevel": 1, "print_hide": 1, "read_only": 1 }, @@ -298,7 +310,7 @@ "icon": "printer", "links": [], "max_attachments": 1, - "modified": "2026-06-08 12:10:35.829531", + "modified": "2026-10-29 12:48:46.566372", "modified_by": "Administrator", "module": "Accounts", "name": "Cheque Print Template", @@ -316,6 +328,12 @@ "share": 1, "write": 1 }, + { + "permlevel": 1, + "read": 1, + "role": "System Manager", + "write": 1 + }, { "create": 1, "delete": 1, diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py index 19ef9ba8f5d..ef05a62c5d2 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py @@ -6,6 +6,7 @@ import re import frappe from frappe import _ from frappe.model.document import Document +from frappe.utils import get_datetime class ChequePrintTemplate(Document): @@ -38,6 +39,7 @@ class ChequePrintTemplate(Document): message_to_show: DF.Data | None payer_name_from_left_edge: DF.Float payer_name_from_top_edge: DF.Float + print_format_creation: DF.Datetime | None scanned_cheque: DF.Attach | None signatory_from_left_edge: DF.Float signatory_from_top_edge: DF.Float @@ -50,6 +52,7 @@ class ChequePrintTemplate(Document): @frappe.whitelist(methods=["POST"]) def create_or_update_cheque_print_format(template_name: str): frappe.only_for("System Manager") + doc = frappe.get_doc("Cheque Print Template", template_name) if not frappe.db.exists("Print Format", template_name): cheque_print = frappe.new_doc("Print Format") @@ -65,8 +68,6 @@ def create_or_update_cheque_print_format(template_name: str): else: cheque_print = frappe.get_doc("Print Format", template_name) - doc = frappe.get_doc("Cheque Print Template", template_name) - account_payee = "" if doc.is_account_payable: account_payee = """ @@ -79,7 +80,7 @@ def create_or_update_cheque_print_format(template_name: str): message_to_show=frappe.as_json(doc.message_to_show or _("Account Pay Only"), ensure_ascii=False), ) - cheque_print.html = """ + cheque_html = """