hi all,
how to override default dashboard? like customer and Sales Invoice dashboard
thank you in advance
hi all,
how to override default dashboard? like customer and Sales Invoice dashboard
thank you in advance
check leave_application.js to override custom dashboard:
make_dashboard: function(frm) {
var leave_details;
if (frm.doc.employee) {
frappe.call({
method: "erpnext.hr.doctype.leave_application.leave_application.get_leave_details",
async: false,
args: {
employee: frm.doc.employee,
date: frm.doc.posting_date
},
callback: function(r) {
if (!r.exc && r.message['leave_allocation']) {
leave_details = r.message['leave_allocation'];
}
if (!r.exc && r.message['leave_approver']) {
frm.set_value('leave_approver', r.message['leave_approver']);
}
}
});
$("div").remove(".form-dashboard-section");
let section = frm.dashboard.add_section(
frappe.render_template('leave_application_dashboard', {
data: leave_details
})
);
frm.dashboard.show();
}
},