How to add option to document status

i need to add an option to attendance document but i cannot change in the development DocType… how can i do this?

Hi,

Can you tell me what exactly it is you’re trying to do and what issue you’re facing?

Thanks

@vjFaLk hi, i need to add a status of Delayed and incomplete day to the attendance entries, i have added login and logout time fields and i will calculate this to see the difference of hours and to see if the employee is delayed, so if the employee login / attend at 8:10 AM he is delayed and the status is delayed, and if he dosnt work 9 Hours will be incomplete day…

am trying to make time sheet alike rules

For making custom code changes you need to have the development setup

Along with that, you need to add

"developer_mode": 1

in your site_config.json in your site folder only then you can modify DocTypes and write custom code and see changes you make in your code.

Refer to our tutorial : https://frappe.github.io/frappe/user/tutorial/

@vjFaLk i did already but forgot to clear the cach now its ok :slight_smile:

last question please, can you help me in a small snippet that will check value of field and change the status depending on this value like below:

if value hours <8 then status of document is incomplete day

I can’t give you exact code because I don’t know how you’ve coded it. However, this is how the logic should work :

On changing / saving your Doc it should check the hours and call a function that will change the status of your Attendance. Have a look at delivery_note.js and delivery_note.py to see how you can do it.

Thank you soooo much @vjFaLk this would make it easier for me, I just needed to know I need to make a custom script or change in the code it self…

@ramielian Get started: http://frappe.github.io/frappe/user/tutorial/