@@ -48,6 +48,7 @@ class HrAttendance(models.Model):
|
||||
is_approval = fields.Boolean(string="是否审批修正", default=False)
|
||||
is_check_in_red = fields.Boolean(string="是否上班打卡异常")
|
||||
is_check_out_red = fields.Boolean(string="是否下班打卡异常")
|
||||
撤销显示条件
|
||||
is_warning = fields.Boolean(compute='_compute_is_warning', string="警告", store=True)
|
||||
|
||||
approval_check_in = fields.Datetime(string="修正前上班打卡时间")
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<field name="workflow_id" optional="hidden"/>
|
||||
<button name="button_controls_wizard" type="object" string="操作" class="oe_highlight" invisible="not (is_abnormal or is_early_card or is_late_card or absenteeism_card or is_no_card)"/>
|
||||
<button name="button_correct_wizard" type="object" string="修正" class="btn btn-primary" invisible="not (is_abnormal or is_early_card or is_late_card or absenteeism_card or is_no_card)" groups="yuthon_hr_attendance.group_he_attendance_sign_manager"/>
|
||||
<button name="revoke" type="object" string="撤销" class="btn btn-primary" invisible="not is_check_out_red or is_check_in_red" groups="yuthon_hr_attendance.group_he_attendance_sign_manager"/>
|
||||
<button name="revoke" type="object" string="撤销" class="btn btn-primary" invisible="not (is_check_out_red or is_check_in_red)" groups="yuthon_hr_attendance.group_he_attendance_sign_manager"/>
|
||||
<button name="button_workflow" type="object" string="流程" class="oe_highlight" invisible="not is_workflow"/>
|
||||
<button name="button_source" type="object" string="详情" class="oe_highlight" groups="yuthon_hr_attendance.group_he_attendance_sign_manager"/>
|
||||
</tree>
|
||||
|
||||
@@ -24,7 +24,8 @@ class AttendanceCorrectWizard(models.TransientModel):
|
||||
'is_early_card': False,
|
||||
'is_late_card': False,
|
||||
'is_check_in_red': False,
|
||||
'is_check_out_red': False
|
||||
'is_check_out_red': False,
|
||||
'absenteeism_card': False,
|
||||
}
|
||||
|
||||
if not record.attendance_id.shift_id:
|
||||
@@ -40,16 +41,6 @@ class AttendanceCorrectWizard(models.TransientModel):
|
||||
max_hour = int(max_hour_to)
|
||||
max_minute = int(max_hour_to * 10 % max_hour_to)
|
||||
will_datetime_end = current_date.replace(year=year, month=month, day=day, hour=max_hour, minute=max_minute) - timedelta(hours=8)
|
||||
# 准备更新的值
|
||||
values = {
|
||||
'is_approval': True,
|
||||
'is_abnormal': False,
|
||||
'is_no_card': False,
|
||||
'is_early_card': False,
|
||||
'is_late_card': False,
|
||||
'is_check_in_red': False,
|
||||
'is_check_out_red': False
|
||||
}
|
||||
# 处理上班打卡
|
||||
if not self.attendance_id.check_in:
|
||||
values['check_in'] = will_datetime_start
|
||||
|
||||
Reference in New Issue
Block a user