From 52093f71fb3bc75fb5b2ef77b5ff8ec161f0e916 Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Mon, 2 Feb 2026 17:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E7=A1=AE=E8=AE=A4=E5=8D=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/controllers/portal.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/yuthon_hr_attendance/controllers/portal.py b/yuthon_hr_attendance/controllers/portal.py index 6ab0e0864..2b3affba1 100644 --- a/yuthon_hr_attendance/controllers/portal.py +++ b/yuthon_hr_attendance/controllers/portal.py @@ -115,17 +115,5 @@ class CustomerPortal(portal.CustomerPortal): @http.route('/phone/vacation/self/status', type='http', auth="none", csrf=False, cors='*') def phone_vacation_self_status(self, **kw): record_id = request.env['yuthon.vacation.reports'].sudo().search([('id', '=', kw.get('id'))]) - month_start = record_id.vacation_date.replace(day=1) - month_end = (month_start + relativedelta(months=1) - relativedelta(days=1)) - attendance_exception = self.env['hr.attendance'].search([ - ('employee_id', '=', record_id.employee_id.id), - ('current_data', '>=', month_start), - ('current_data', '<=', month_end), - ('is_abnormal', '=', True) - ], limit=1) - # 如果考勤异常,则不自动确认 - if attendance_exception: - return json.dumps({'code': 200, 'message': '考勤异常,请先核对考勤记录'}) - else: - record_id.write({'vacation_state': 'confirmed'}) - return json.dumps({'code': 200, 'message': 'OK'}) + record_id.write({'vacation_state': 'confirmed'}) + return json.dumps({'code': 200, 'message': 'OK'})