From 804dd957a9d85f5004797c686e2daff078c1bc94 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Tue, 3 Jun 2025 19:18:24 +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 --- .../models/yuthon_vacation_reports.py | 59 +++++++++++++++++- yuthon_holiday/security/ir.model.access.csv | 4 ++ .../views/yuthon_vacation_reports_views.xml | 61 ++++++++++++++++++- .../views/hr_attendance_month_views.xml | 6 +- .../wizard/hr_attendance_month_wizard.py | 32 ++++++---- .../views/yuthon_hr_employee_views.xml | 14 ++--- yuthon_salary/models/inherit_hr_payslip.py | 2 +- .../models/inherit_hr_payslip_run.py | 10 ++- .../views/inherit_hr_payslip_run_views.xml | 6 +- yuthon_salary/wizard/put_return_wizard.py | 4 ++ yuthon_salary/wizard/salary_compute_wizard.py | 21 +++---- .../wizard/salary_compute_wizard_views.xml | 6 +- yuthon_salary/wizard/salary_print_wizard.py | 7 +++ yuthon_work_brand/views/hr_menus.xml | 2 +- 14 files changed, 184 insertions(+), 50 deletions(-) diff --git a/yuthon_holiday/models/yuthon_vacation_reports.py b/yuthon_holiday/models/yuthon_vacation_reports.py index 05509abd1..6b6584dd5 100644 --- a/yuthon_holiday/models/yuthon_vacation_reports.py +++ b/yuthon_holiday/models/yuthon_vacation_reports.py @@ -12,7 +12,10 @@ class YuthonVacationReports(models.Model): company_id = fields.Many2one(related="employee_id.company_id", string="公司") leave = fields.Float(string='年假') working_overtime = fields.Float(string='加班时') - meal_fee = fields.Integer(string="误餐费") + meal_fee = fields.Integer(string="误餐次数") + leave_ids = fields.One2many('vacation.leave.line', 'vacation_id', string='年假明细') + overtime_ids = fields.One2many('vacation.over.line', 'vacation_id', string='加班明细') + meal_fee_ids = fields.One2many('vacation.meal.line', 'vacation_id', string='误餐明细') def button_fixes_approval(self): form_id = self.env.ref('yuthon_holiday.view_yuthon_fixes_approval_form').id @@ -37,8 +40,9 @@ class YuthonVacationReports(models.Model): 'res_model': 'soong.workflow.record', 'view_mode': 'tree', 'domain': domain, - 'context': {'group_by': ['workflow_id']} - } + 'context': {'group_by': ['workflow_id'], + 'tree_view_ref':'yuthon_holiday.details_tree_view', + }} return action def update_vacation(self): @@ -66,6 +70,55 @@ class YuthonVacationReports(models.Model): }) + def log(self): + return { + "type": "ir.actions.act_window", + "res_model": 'yuthon.vacation.reports', + "res_id": self.id, + "name": "详情", + "view_mode": "form", + } + + +class VacationLeaveLine(models.Model): + _name = 'vacation.leave.line' + _description = '年假明细' + + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期报表') + update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型') + update_date = fields.Date(string='更新时间') + update_lines = fields.Text(string='更新额度') + + +class VacationOverline(models.Model): + _name = 'vacation.over.line' + _description = '加班明细' + + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期报表') + update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型') + update_date = fields.Date(string='更新时间') + update_lines = fields.Text(string='更新额度') + + +class VacationMealLine(models.Model): + _name = 'vacation.meal.line' + _description = '误餐明细' + + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期报表') + update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型') + update_date = fields.Date(string='更新时间') + update_lines = fields.Text(string='更新额度') + + +class DetailsTree(models.Model): + _name = 'details.tree' + _description = '明细表' + + code = fields.Char() + name = fields.Char() + + + diff --git a/yuthon_holiday/security/ir.model.access.csv b/yuthon_holiday/security/ir.model.access.csv index 08ace331c..07834f674 100644 --- a/yuthon_holiday/security/ir.model.access.csv +++ b/yuthon_holiday/security/ir.model.access.csv @@ -7,3 +7,7 @@ access_yuthon_holiday_setting,yuthon_holiday_setting,model_yuthon_holiday_settin access_leave_allocation_wizard,leave_allocation_wizard,model_leave_allocation_wizard,base.group_user,1,1,1,1 access_yuthon_leave_wizard,yuthon_leave_wizard,model_yuthon_leave_wizard,base.group_user,1,1,1,1 access_yuthon_vacation_reports,yuthon_vacation_reports,model_yuthon_vacation_reports,base.group_user,1,1,1,1 +access_vacation_leave_line,vacation_leave_line,model_vacation_leave_line,base.group_user,1,1,1,1 +access_vacation_meal_line,vacation_meal_line,model_vacation_meal_line,base.group_user,1,1,1,1 +access_vacation_over_line,vacation_over_line,model_vacation_over_line,base.group_user,1,1,1,1 +access_details_tree, details_tree,model_details_tree,base.group_user,1,1,1,1 diff --git a/yuthon_holiday/views/yuthon_vacation_reports_views.xml b/yuthon_holiday/views/yuthon_vacation_reports_views.xml index ed9f2284e..8353e9459 100644 --- a/yuthon_holiday/views/yuthon_vacation_reports_views.xml +++ b/yuthon_holiday/views/yuthon_vacation_reports_views.xml @@ -12,13 +12,56 @@