We can submit the attendance of the current user, as soon as the user login.
each activity stored a new record in the Activity log, so on successful login activity, we can trigger submit attendance.
if doc.operation == 'Login':
employee_name_for_auto_attandenace = doc.full_name
today_attendance_date = frappe.utils.today()
frappe.get_doc(dict(
doctype = 'Attendance',
employee_name = 'employee_name_for_auto_attandenace',
attendance_date = today_attendance_date
)).submit()
frappe.msgprint(msg=('Attendance for ' + doc.full_name + 'has been created'))
Yes, It worked.
But for some user, it gives the error because the user’s name and employee name didn’t match like user’s name full name: Meet, employee full name: Meetkumar Patel, for this I need to fetch employee name or set equal name in the user name and employee name. @nomanhaider
Yea,
If you are using Frappe Cloud, you can find in site config. or if you are on own server, I think you need to setup in site_config.json file @dineshpanchal432