From 7477cc6545cfaf94c7bd7e67e49c3f1df4e7beb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Thu, 26 Feb 2026 15:46:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/models/yuthon_vacation_reports.py | 6 ++++++ .../views/yuthon_vacation_reports_views.xml | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 793fc188b..dbaa06b55 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -184,6 +184,12 @@ class YuthonVacationReports(models.Model): else: rec.remaining_number_card = 3 + def all_update_line(self): + records = self.env["yuthon.vacation.reports"].browse( + self._context.get('active_ids', self._context.get('active_id', self.ids)) + ) + for rec in records: + rec.update_line() def update_line(self): self.manage_reject() diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml index 53d677e0f..43ba6369c 100644 --- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml +++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml @@ -773,6 +773,13 @@ code action = model.update_vacation() + + + 批量重新计算 + + + code + action = model.all_update_line() 一次性