diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js index 17cb8d00e48..7ce14b6c235 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.js @@ -6,12 +6,14 @@ frappe.provide("erpnext.cheque_print"); frappe.ui.form.on("Cheque Print Template", { refresh: function (frm) { if (!frm.doc.__islocal) { - frm.add_custom_button( - frm.doc.has_print_format ? __("Update Print Format") : __("Create Print Format"), - function () { - erpnext.cheque_print.view_cheque_print(frm); - } - ).addClass("btn-primary"); + if (frappe.user.has_role("System Manager")) { + frm.add_custom_button( + frm.doc.has_print_format ? __("Update Print Format") : __("Create Print Format"), + function () { + erpnext.cheque_print.view_cheque_print(frm); + } + ).addClass("btn-primary"); + } $(frm.fields_dict.cheque_print_preview.wrapper).empty(); 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 46380db30ac..155fc43c5f7 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.json @@ -1,5 +1,6 @@ { "actions": [], + "allow_bulk_edit": 1, "autoname": "field:bank_name", "creation": "2016-05-04 14:35:00.402544", "doctype": "DocType", @@ -294,7 +295,7 @@ ], "links": [], "max_attachments": 1, - "modified": "2024-03-27 13:06:44.654989", + "modified": "2026-06-08 12:10:35.829531", "modified_by": "Administrator", "module": "Accounts", "name": "Cheque Print Template", @@ -325,19 +326,17 @@ "write": 1 }, { - "create": 1, - "delete": 1, "email": 1, "export": 1, "print": 1, "read": 1, "report": 1, "role": "Accounts User", - "share": 1, - "write": 1 + "share": 1 } ], + "row_format": "Dynamic", "sort_field": "creation", "sort_order": "DESC", "states": [] -} \ No newline at end of file +} 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 4b1394ede17..d897db2a7a4 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py @@ -48,6 +48,8 @@ class ChequePrintTemplate(Document): @frappe.whitelist() def create_or_update_cheque_print_format(template_name): + frappe.only_for("System Manager") + if not frappe.db.exists("Print Format", template_name): cheque_print = frappe.new_doc("Print Format") cheque_print.update(