!8830 请假导出

Merge pull request !8830 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-02-09 10:03:50 +00:00
committed by Gitee
2 changed files with 20 additions and 19 deletions
@@ -93,16 +93,15 @@ class ExportDateWizard(models.TransientModel):
domain = [
('date_from', '>=', start_date),
('date_from', '<', end_date),
('is_filiing', '=', True)
('date_from', '<', end_date)
]
if active_ids:
domain = [('id', 'in', active_ids)] + domain
filtered_records = self.env['hr.leave'].search(domain)
if not filtered_records:
raise UserError(f'在 {self.year} 年 {self.month} 月没有找到符合条件的归档请假记录(is_filiing=True)')
raise UserError(f'在 {self.year} 年 {self.month} 月没有找到符合条件的归档请假记录')
filtered_ids = filtered_records.ids
+17 -15
View File
@@ -198,22 +198,24 @@ class WeComApps(models.Model):
"btntxt": btntxt
},
}
result_data = self.sync_function_api("message_send", "MESSAGE_SEND", data, category)
employee_id = self.sudo().env["res.users"].search([("login", "=", user_id)], limit=1).employee_ids
notice_type = 'attendance' if '记得打卡' in description else 'process'
service_address = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
self.env["attendance.message.log"].create({
"employee_id": employee_id.id,
"content": description,
"notice_type": notice_type,
"service_address":service_address,
'update_date': fields.Datetime.now(),
"message_url": url,
})
_logger.info(f"------------------------接口收到响应返回值{result_data}-------------------------------")
if result_data.get("errcode", None) == 0:
return True, result_data
return False, result_data
_logger.info(f"企业微信接口请求地址{service_address}-------------------------------")
if '8057' not in service_address:
result_data = self.sync_function_api("message_send", "MESSAGE_SEND", data, category)
employee_id = self.sudo().env["res.users"].search([("login", "=", user_id)], limit=1).employee_ids
notice_type = 'attendance' if '记得打卡' in description else 'process'
self.env["attendance.message.log"].create({
"employee_id": employee_id.id,
"content": description,
"notice_type": notice_type,
"service_address":service_address,
'update_date': fields.Datetime.now(),
"message_url": url,
})
_logger.info(f"------------------------接口收到响应返回值{result_data}-------------------------------")
if result_data.get("errcode", None) == 0:
return True, result_data
return False, result_data
def sync_user_update(self, user_id=None, name=None, mobile=None, biz_mail=None, department=None):
data = {}