From 346397c35feaea22f883d5d4f0e109732e471715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Thu, 5 Mar 2026 22:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=E7=A1=AE=E8=AE=A4=E5=8D=95?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_hr_attendance/__manifest__.py | 1 + .../models/yuthon_vacation_reports.py | 15 ++++++ .../security/ir.model.access.csv | 3 +- .../views/yuthon_vacation_reports_views.xml | 1 + yuthon_hr_attendance/wizard/__init__.py | 1 + .../wizard/overtime_change_wizard.py | 54 +++++++++++++++++++ .../wizard/overtime_change_wizard_views.xml | 52 ++++++++++++++++++ 7 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 yuthon_hr_attendance/wizard/overtime_change_wizard.py create mode 100644 yuthon_hr_attendance/wizard/overtime_change_wizard_views.xml diff --git a/yuthon_hr_attendance/__manifest__.py b/yuthon_hr_attendance/__manifest__.py index ce6fbd68d..10eeab9cb 100644 --- a/yuthon_hr_attendance/__manifest__.py +++ b/yuthon_hr_attendance/__manifest__.py @@ -85,6 +85,7 @@ 'wizard/yuthon_run_wizard.xml', 'wizard/applet_security_quick_perm_views.xml', 'wizard/export_date_wizard_views.xml', + 'wizard/overtime_change_wizard_views.xml', 'report/overtime_approval_report.xml', 'report/overtime_approval_templates.xml', ], diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 617396b35..5bc5e0918 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -1439,6 +1439,21 @@ class YuthonVacationReports(models.Model): record.overtime_public_holidays_total = public_holidays_total record.overtime_grand_total = workday_total + legal_day_total + public_holidays_total + def action_overtime_change(self): + """打开加班变更向导""" + self.ensure_one() + return { + 'name': '加班变更', + 'type': 'ir.actions.act_window', + 'res_model': 'overtime.change.wizard', + 'view_mode': 'form', + 'target': 'new', + 'context': { + 'active_model': 'yuthon.vacation.reports', + 'active_id': self.id, + }, + } + @api.depends('meal_fee_ids.update_lines', 'meal_fee_ids.update_type', 'meal_fee_ids.is_void') def _compute_meal_fee(self): for record in self: diff --git a/yuthon_hr_attendance/security/ir.model.access.csv b/yuthon_hr_attendance/security/ir.model.access.csv index 4a6a037ac..0b478949e 100644 --- a/yuthon_hr_attendance/security/ir.model.access.csv +++ b/yuthon_hr_attendance/security/ir.model.access.csv @@ -94,4 +94,5 @@ access_yuthon_overtime_line,yuthon.overtime.line,model_yuthon_overtime_line,base access_overtime_active_line,overtime.active.line,model_overtime_active_line,base.group_user,1,1,1,1 access_export_date_wizard,export.date.wizard,model_export_date_wizard,base.group_user,1,1,1,1 access_vacation_meal_active,vacation.meal.active,model_vacation_meal_active,base.group_user,1,1,1,1 -access_yuthon_vacation_import_wizard,yuthon.vacation.import.wizard,model_yuthon_vacation_import_wizard,base.group_user,1,1,1,1 \ No newline at end of file +access_yuthon_vacation_import_wizard,yuthon.vacation.import.wizard,model_yuthon_vacation_import_wizard,base.group_user,1,1,1,1 +access_overtime_change_wizard,overtime.change.wizard,model_overtime_change_wizard,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml index bb15a57f6..e499ec0da 100644 --- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml +++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml @@ -250,6 +250,7 @@