考勤跳转

This commit is contained in:
pengyuthon
2026-01-25 18:42:00 +08:00
parent 13fa2f119e
commit 914c882d84
2 changed files with 22 additions and 23 deletions
@@ -541,22 +541,26 @@ class YuthonVacationReports(models.Model):
}
def all_put(self):
vacation_ids = self.env["yuthon.vacation.reports"].browse(
self._context.get('active_ids', self._context.get('active_id')))
vacation_list = []
vacation_ids = self.env["yuthon.vacation.reports"].browse(self._context.get('active_ids', self._context.get('active_id')))
for rec in vacation_ids:
vacation_list.append(rec.id)
we_id = rec.employee_id.wecom_userid
year = rec.vacation_date.year
month = rec.vacation_date.month
message = f"你{year}年{month}月的考勤确认单已经生成,请到手机端确认"
if we_id:
self.sudo().env["wecom.apps"].sync_send_message(category='att', user_id=we_id, message=message,)
self.sudo().env["wecom.apps"].sync_send_message(category='att', user_id="18562027762", message=message)
rec.write({'vacation_state': 'pending'})
return {
'type': 'ir.actions.act_window',
'name': '批量发送确认弹窗',
'res_model': 'vacation.put.wizard',
'view_mode': 'form',
'target': 'new',
'context': {'default_vacation_ids': [(6, 0, [vacation_list])]
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'type': 'success',
'message': '已发送提醒消息',
'sticky': False,
}
}
def manage_confirmation(self):
vacation_ids = self.env["yuthon.vacation.reports"].browse(
self._context.get('active_ids', self._context.get('active_id')))
@@ -26,15 +26,10 @@ class VacationPutWizard(models.TransientModel):
elif report.vacation_date > employee_reports_map[emp].vacation_date:
employee_reports_map[emp] = report
for employee, report in employee_reports_map.items():
url = f'https://oa.thtzjt.com/webh5/#/vacation?id={report.id}'
we_id = employee.wecom_userid
if we_id:
self.sudo().env["wecom.apps"].sync_send_message_textcard(
category='default',
user_id=we_id,
title="考勤确认",
description=f'{employee.name} 请确认你的考勤:',
url=url,
btntxt="详细信息"
)
# for employee, report in employee_reports_map.items():
# we_id = employee.wecom_userid
# message = f"你{self.select_year}年{self.select_time}月的考勤确认单已经生成,请到手机端确认",
# if we_id:
# self.sudo().env["wecom.apps"].sync_send_message(category='att', user_id=we_id, message=message,)
# self.sudo().env["wecom.apps"].sync_send_message(category='att', user_id="18562027762", message=message,)
# self.write({'confirm_status': 'un_confirm'})