mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 07:01:56 +00:00
fix(cheque_print_template): print format creation from cheque print template requires system manager (backport #55708) (#55711)
Co-authored-by: Diptanil Saha <diptanil@frappe.io> fix(cheque_print_template): print format creation from cheque print template requires system manager (#55708)
This commit is contained in:
@@ -6,12 +6,14 @@ frappe.provide("erpnext.cheque_print");
|
|||||||
frappe.ui.form.on("Cheque Print Template", {
|
frappe.ui.form.on("Cheque Print Template", {
|
||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
if (!frm.doc.__islocal) {
|
if (!frm.doc.__islocal) {
|
||||||
frm.add_custom_button(
|
if (frappe.user.has_role("System Manager")) {
|
||||||
frm.doc.has_print_format ? __("Update Print Format") : __("Create Print Format"),
|
frm.add_custom_button(
|
||||||
function () {
|
frm.doc.has_print_format ? __("Update Print Format") : __("Create Print Format"),
|
||||||
erpnext.cheque_print.view_cheque_print(frm);
|
function () {
|
||||||
}
|
erpnext.cheque_print.view_cheque_print(frm);
|
||||||
).addClass("btn-primary");
|
}
|
||||||
|
).addClass("btn-primary");
|
||||||
|
}
|
||||||
|
|
||||||
$(frm.fields_dict.cheque_print_preview.wrapper).empty();
|
$(frm.fields_dict.cheque_print_preview.wrapper).empty();
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -48,6 +48,8 @@ class ChequePrintTemplate(Document):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_or_update_cheque_print_format(template_name):
|
def create_or_update_cheque_print_format(template_name):
|
||||||
|
frappe.only_for("System Manager")
|
||||||
|
|
||||||
if not frappe.db.exists("Print Format", template_name):
|
if not frappe.db.exists("Print Format", template_name):
|
||||||
cheque_print = frappe.new_doc("Print Format")
|
cheque_print = frappe.new_doc("Print Format")
|
||||||
cheque_print.update(
|
cheque_print.update(
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ field_map = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
columns, data = get_columns(filters), get_data(filters)
|
columns, data = get_columns(filters), get_data(filters)
|
||||||
return columns, data
|
return columns, data
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ def get_timesheets(project, start=0, search=None):
|
|||||||
timesheet.update(info[0])
|
timesheet.update(info[0])
|
||||||
return timesheets
|
return timesheets
|
||||||
|
|
||||||
|
|
||||||
def get_attachments(project):
|
def get_attachments(project):
|
||||||
return frappe.get_all(
|
return frappe.get_all(
|
||||||
"File",
|
"File",
|
||||||
|
|||||||
Reference in New Issue
Block a user