How to remove mark attendance for employees

How can I remove mark attendance option for employees

That for, you have to apply the listview client script.

frappe.listview_settings['Attendance'] = {
    onload: function(listview) {
        $('button.btn.btn-default.ellipsis').hide();
    }
};
1 Like

Ensure the user have only employee role

1 Like

@NCP i tried this script not working

Hi @Prashanth_Kolhetkar,

Please apply it in the client script doctype.

@NCP When I enabled this script, the status of my attendance was shown as “Submitted” and not absent or “present”. How to solve this?

l have the same issue

That for, you have to override the listview method.

Reference:

function extend_listview_event(doctype, event, callback) {
    if (!frappe.listview_settings[doctype]) {
        frappe.listview_settings[doctype] = {};
    }

    const old_event = frappe.listview_settings[doctype][event];
    frappe.listview_settings[doctype][event] = function (listview) {
        if (old_event) {
            old_event(listview);
        }
        callback(listview);
    };
}

extend_listview_event("Attendance", "onload", function (listview) {
    $('button.btn.btn-default.ellipsis').hide();
});
1 Like

this worked thx

Thanks, that worked