This commit is contained in:
mohammed-alkhazrji 2025-12-23 23:04:54 +03:00
parent cb2001662d
commit e4dd586cef
3 changed files with 4 additions and 1 deletions

View File

@ -12,6 +12,7 @@ class SystemAttendance(models.Model):
_order = 'punch_time DESC'
punch_state = fields.Char("Punch state", readonly=True)
punch_state_display = fields.Char("Punch state display", readonly=True)
area_alias = fields.Char("Area", readonly=True)
crc = fields.Char("CRC", readonly=True)
verify_type = fields.Integer("Verify type", readonly=True)
@ -551,6 +552,7 @@ class BiotimeAPI(models.Model):
data = {
'attendance_id': tx['id'],
'punch_state': tx['punch_state'],
'punch_state_display': tx['punch_state_display'],
'area_alias': tx['area_alias'],
# 'crc': tx['crc'],
'crc': tx['emp'],

View File

@ -222,6 +222,7 @@
<field name="attendance_id"/>
<field name="punch_time"/>
<field name="punch_state"/>
<field name="punch_state_display"/>
<field name="area_alias"/>
<field name="verify_type"/>
<field name="terminal_id"/>

View File

@ -45,7 +45,7 @@ class AttendanceWizard(models.TransientModel):
attendance.create({
'employee_id': tx.emp_code.hr_employee.id,
'name': tx.punch_time,
'action': 'sign_in' if tx.punch_state in ["1", "4", "5"] else 'sign_out',
'action': 'sign_in' if tx.punch_state in ["0", "2", "4"] else 'sign_out',
'action_date': tx.punch_time,
})
tx.write({