diff --git a/frappe/public/js/frappe/utils/utils.js b/frappe/public/js/frappe/utils/utils.js index fe80ac8231..484d9c65f1 100644 --- a/frappe/public/js/frappe/utils/utils.js +++ b/frappe/public/js/frappe/utils/utils.js @@ -1197,10 +1197,12 @@ Object.assign(frappe.utils, { route = ""; } } - } else if (type === "report" && item.is_query_report) { - route = "query-report/" + item.name; } else if (type === "report") { - route = frappe.router.slug(item.name) + "/view/report"; + if (item.is_query_report) { + route = "query-report/" + item.name; + } else { + route = frappe.router.slug(item.doctype) + "/view/report/" + item.name; + } } else if (type === "page") { route = item.name; } else if (type === "dashboard") { diff --git a/frappe/public/js/frappe/widgets/links_widget.js b/frappe/public/js/frappe/widgets/links_widget.js index 05280a22c8..70a6242589 100644 --- a/frappe/public/js/frappe/widgets/links_widget.js +++ b/frappe/public/js/frappe/widgets/links_widget.js @@ -61,11 +61,17 @@ export default class LinksWidget extends Widget { }; this.link_list = this.links.map(item => { - const route = frappe.utils.generate_route({ + const opts = { name: item.link_to, type: item.link_type, is_query_report: item.is_query_report - }); + } + + if (item.link_type == "Report" && !item.is_query_report) { + opts.doctype = item.dependencies; + } + + const route = frappe.utils.generate_route(opts); return $(`