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() 一次性