Why does the system create a value for a Time datafield if it's empty?!

Hello, I have two fields of Time datatype. When I save the document and leave them empty, it saves the values as the current time by default as you see below in the photos!!!

The custom fields are not mandatory but still, it creates values to them.

I imported 2500 documents by data import and the results were horribale.

Any suggestion?

I’m not able to reproduce this. If you go to the Customize Doctype tool, is there a default value set?

By default it’s empty and I want it empty.
However, before saving the document, the system checks if the field is empty then it sets the value as Time now and I want it to keep empty.

Can you show us the field details in the customize forms tool?



By the way, I added a client script to block this problem. But it only works while creating the attendance manually. If I tried to upload the data using the data import tool, the problem comes again, and set the time now as a value for the blank fields.

frappe.ui.form.on('Attendance', {
	 before_save: function (frm) {
		if(frm.doc.check_in = ""){
		    frm.set_value("check_in", "");
		}
		if(frm.doc.check_out = ""){
		    frm.set_value("check_out", "");
		}
	}
})

 
2 Likes

Hmm…sorry, I’m not able to reproduce this on my system. I’d suggest testing again on a new field (and, if necessary, doctype) to see if the issue is local or global.