Merge pull request #14449 from surajshetty3416/fix-print-format-default

This commit is contained in:
Suraj Shetty 2021-10-14 11:08:37 +05:30 committed by GitHub
commit 1eb772f555
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ frappe.ui.form.on("Print Format", {
else if (frm.doc.custom_format && !frm.doc.raw_printing) {
frm.set_df_property("html", "reqd", 1);
}
if (frappe.perm.has_perm('DocType', 0, 'read', frm.doc.doc_type)) {
if (frappe.model.can_read(frm.doc.doc_type)) {
frappe.db.get_value('DocType', frm.doc.doc_type, 'default_print_format', (r) => {
if (r.default_print_format != frm.doc.name) {
frm.add_custom_button(__("Set as Default"), function () {