diff --git a/ssi_fingerspot/models/fingerspot_attendance_machine.py b/ssi_fingerspot/models/fingerspot_attendance_machine.py index 1793ee0..fa28931 100644 --- a/ssi_fingerspot/models/fingerspot_attendance_machine.py +++ b/ssi_fingerspot/models/fingerspot_attendance_machine.py @@ -62,6 +62,12 @@ class FingerspotAttendanceMachine(models.Model): copy=False, readonly=True, ) + is_skip = fields.Boolean( + string="Is Skip?", + required=False, + copy=False, + readonly=True, + ) err_msg = fields.Char( string="Error", default="-", @@ -131,6 +137,14 @@ def action_unmark_is_transfer(self): for record in self: record.is_transfer = False + def action_mark_is_skip(self): + for record in self: + record.is_skip = True + + def action_unmark_is_skip(self): + for record in self: + record.is_skip = False + def _get_latest_attendance(self): self.ensure_one() obj_attendance = self.env["hr.timesheet_attendance"] @@ -267,7 +281,7 @@ def _generate_attendances(self): def action_generate_attendances(self): to_generate = self.filtered( - lambda x: x.is_transfer is False and x.employee_id + lambda x: x.is_transfer is False and x.is_skip is False and x.employee_id ).sorted(lambda m: (m.pin)) tz = pytz.timezone(self.env.user.tz or "Asia/Jakarta") diff --git a/ssi_fingerspot/views/fingerspot_attendance_machine_views.xml b/ssi_fingerspot/views/fingerspot_attendance_machine_views.xml index d29cef7..3b144cc 100644 --- a/ssi_fingerspot/views/fingerspot_attendance_machine_views.xml +++ b/ssi_fingerspot/views/fingerspot_attendance_machine_views.xml @@ -15,12 +15,18 @@ + + + @@ -73,6 +84,16 @@ name="action_unmark_is_transfer" type="object" string="Unmark Is Transfer" + /> +