@@ -386,6 +386,20 @@ class HrAttendanceDetail(models.Model):
|
||||
sch_check_out_time = sch_check_out_time - timedelta(hours=1)
|
||||
|
||||
is_early_card, is_late_card, is_abnormal, is_warning, absenteeism_card, is_no_card = self.state_judgment(employee, check_in_time, check_out_time, sch_check_in_time, sch_check_out_time, current_data, is_manual, attendance)
|
||||
|
||||
# 如果是厨卫的 只用判断范围内是否打卡了 如果打卡就不算异常
|
||||
if template.role_id.name == '厨卫(集团)':
|
||||
is_early_card = False
|
||||
is_late_card = False
|
||||
if check_in_time and check_out_time:
|
||||
is_abnormal = False
|
||||
is_no_card = False
|
||||
absenteeism_card = False
|
||||
else:
|
||||
is_abnormal = True
|
||||
is_no_card = True
|
||||
absenteeism_card = True
|
||||
|
||||
is_expatriation = self.env['expatriation.approval'].search([('work_end', '=', True),('expatriates_ids', 'in', [employee.id]), ('is_effect', '=', False)])
|
||||
if not self._process_shift_days(current_data) and template.role_id.name == '集团行政':
|
||||
start_datetime = datetime.combine(current_data, datetime.min.time())
|
||||
@@ -486,10 +500,6 @@ class HrAttendanceDetail(models.Model):
|
||||
start_datetime = datetime.combine(date, datetime.min.time()).replace(
|
||||
hour=start_hour, minute=start_minute, second=0, microsecond=0
|
||||
) - timedelta(hours=8)
|
||||
if template.planning_name == '厨卫(集团本部)':
|
||||
start_datetime = datetime.combine(date, datetime.min.time()).replace(
|
||||
hour=start_hour, minute=start_minute, second=0, microsecond=0
|
||||
) - timedelta(hours=6)
|
||||
if template.day2 == '次日':
|
||||
end_datetime = datetime.combine(date, datetime.min.time()).replace(
|
||||
hour=end_hour, minute=end_minute, second=0, microsecond=0
|
||||
|
||||
@@ -34,7 +34,7 @@ class YuthonConfirmUsers(models.Model):
|
||||
confirm_noice_ids = self.env["yuthon.confirm.users"].browse(self._context.get('active_ids', self._context.get('active_id')))
|
||||
for record in confirm_noice_ids:
|
||||
if record.state == 'state':
|
||||
raise UserError(f'{record.notice_name}通知还未发送,无法撤回')
|
||||
raise UserError(f'{record.notice_id.name}通知还未发送,无法撤回')
|
||||
record.withdrawn()
|
||||
|
||||
def sync_confirm_users_notices(self):
|
||||
@@ -43,7 +43,7 @@ class YuthonConfirmUsers(models.Model):
|
||||
record.with_context(lang=record.env.lang)._message_auto_subscribe_notify(partner_ids, 'yuthon_notice.message_yuthon_confirm_users_data')
|
||||
url = f'https://phone.thtzjt.com/phone/Notice/{self.notice_id.id}?employee_id={record.employee_id.id}'
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='notice', touser=record.employee_id.wecom_userid, title="通知公告",
|
||||
description="您有待确认的通知公告请尽快确认", url=url, btntxt="详细信息")
|
||||
description=f"您有一条【{record.notice_id.name}】的通知公告请尽快确认", url=url, btntxt="详细信息")
|
||||
|
||||
|
||||
def reminders_notice(self):
|
||||
@@ -52,7 +52,7 @@ class YuthonConfirmUsers(models.Model):
|
||||
for rec in confirm_noice_ids:
|
||||
url = f'https://phone.thtzjt.com/phone/Notice/{self.notice_id.id}?employee_id={rec.employee_id.id}'
|
||||
result_data = self.sudo().env["wecom.apps"].sync_send_message_textcard(category='notice', touser=rec.employee_id.wecom_userid,
|
||||
title="通知公告(催办)", description="您有待确认的通知公告请尽快确认",
|
||||
title="通知公告(催办)", description=f"您有一条【{rec.notice_id.name}】的通知公告请尽快确认",
|
||||
url=url, btntxt="详细信息")
|
||||
if result_data:
|
||||
res_dict = result_data[1]
|
||||
@@ -75,7 +75,7 @@ class YuthonConfirmUsers(models.Model):
|
||||
result_data = self.sudo().env["wecom.apps"].sync_send_message_textcard(category='notice',
|
||||
touser=rec.employee_id.wecom_userid,
|
||||
title="通知公告",
|
||||
description="您有待确认的通知公告请尽快确认",
|
||||
description=f"您有一条【{rec.notice_id.name}】待确认的通知公告请尽快确认",
|
||||
url=url, btntxt="详细信息")
|
||||
if result_data:
|
||||
res_dict = result_data[1]
|
||||
|
||||
Reference in New Issue
Block a user