diff --git a/frappe/printing/doctype/print_format/print_format.js b/frappe/printing/doctype/print_format/print_format.js index adc5e2363c..7b7009dbaf 100644 --- a/frappe/printing/doctype/print_format/print_format.js +++ b/frappe/printing/doctype/print_format/print_format.js @@ -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 () { diff --git a/frappe/public/js/frappe/router.js b/frappe/public/js/frappe/router.js index 349eadffb0..cf132c82ea 100644 --- a/frappe/public/js/frappe/router.js +++ b/frappe/public/js/frappe/router.js @@ -56,6 +56,11 @@ $('body').on('click', 'a', function(e) { return override(e.currentTarget.hash); } + if (frappe.router.is_app_route(e.currentTarget.pathname)) { + // target has "/app, this is a v2 style route. + return override(e.currentTarget.pathname + e.currentTarget.hash); + } + }); frappe.router = {