Attendance status draft

Attendance status should be open in place of Draft when I am applying for attendance and savings then its coming Draft

I want it should come as open by default when I will apply for attendance then reporting person should change status present, absent, on leave

@Prashanth_Kolhetkar
As soon as Attendance is not submitted. The Status will show draft. As its a core document you cannot change the Status Select field to your liking.

You could create a workflow and and uncheck “Don’t override Status” then you can define the status and roles you would like to display.

get_indicator: function (doc) {
if ([“Present”, “Work From Home”].includes(doc.status)) {
return [(doc.status), “green”, “status,=,” + doc.status];
} else if ([“Draft”].includes(doc.status)) {
return [
(“Open”), “green”, “status,=,” + “Open”];
}else if ([“Absent”, “On Leave”].includes(doc.status)) {
return [(doc.status), “red”, “status,=,” + doc.status];
} else if (doc.status == “Half Day”) {
return [
(doc.status), “orange”, “status,=,” + doc.status];
}
}, just create one file for that attendence_list.js and override doctype list js in hooks.py

1 Like

@Jeel I never written code via hook could you explain me in detail how to write in hook and how to access hook file

Please give step by step how to do, i am also facing the same issue
hooks thing and all

  1. create public folder in your custom app.
  2. inside this folder create another folder js folder.
  3. create attendence_list.js file inside this folder.
  4. in hooks.py add doctype_list_js={‘attendence’:public/js/attendence_list.js}
    Refrence:List
1 Like

You can create client script also for that.you can refer this List

1 Like