From 8c881dc94f5e2dc3ed73e25282478f55bdeb2957 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: Mon, 1 Dec 2025 14:44:40 +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 | 8 ++++---- .../views/yuthon_vacation_reports_views.xml | 3 +++ .../models/property_lease_contract.py | 8 +++++++- yuthon_salary/wizard/salary_compute_wizard.py | 8 +++++++- yuthon_work_brand/views/hr_menus.xml | 10 ---------- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 972120f8c..c820787da 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -16,8 +16,9 @@ class YuthonVacationReports(models.Model): _order = "vacation_date desc" employee_id = fields.Many2one('hr.employee', string='员工') - department_id = fields.Many2one(related='employee_id.department_id', string="部门") - company_id = fields.Many2one(related="employee_id.company_id", string="公司") + salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资单分组", store=True) + department_id = fields.Many2one(related='employee_id.department_id', string="部门", store=True) + company_id = fields.Many2one(related="employee_id.company_id", string="公司", store=True) late_allowed = fields.Float(related="employee_id.late_allowed", string="允许迟到次数") leave_ids = fields.One2many('vacation.leave.line', 'vacation_id', string='年假明细') overtime_ids = fields.One2many('vacation.over.line', 'vacation_id', string='加班明细') @@ -182,12 +183,11 @@ class YuthonVacationReports(models.Model): month = rec.vacation_date.month month_start = date(year, month, 1) entry_date = rec.employee_id.entry_date + days_in_month = calendar.monthrange(year, month)[1] if not entry_date or month_start > entry_date: start_day = 1 else: - days_in_month = (date(year, month + 1, 1) - timedelta(days=1)).day start_day = min(entry_date.day, days_in_month) - days_in_month = (date(year, month + 1, 1) - timedelta(days=1)).day actual_days_range = range(start_day, days_in_month + 1) for day in actual_days_range: current_date = date(year, month, day) diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml index 1277cf5f1..eafe6843d 100644 --- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml +++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml @@ -284,6 +284,9 @@ + + + diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index e1508a735..8e61a974b 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -591,7 +591,13 @@ class PropertyLeaseContract(models.Model): def action_open_contract(self): self.ensure_one() action = self.env["ir.actions.actions"]._for_xml_id("yuthon_property_approval.property_accounts_receivable_action") - action.update({'domain': [('contract_id', '=', self.id)]}) + action.update({ + 'domain': [('contract_id', '=', self.id)], + 'context': { + 'search_default_group_by_management_type_id': 1, + 'group_by': 'management_type_id' + } + }) return action def action_open_reconciliation(self): diff --git a/yuthon_salary/wizard/salary_compute_wizard.py b/yuthon_salary/wizard/salary_compute_wizard.py index 3f8c33b0a..56cbc4f8c 100644 --- a/yuthon_salary/wizard/salary_compute_wizard.py +++ b/yuthon_salary/wizard/salary_compute_wizard.py @@ -63,7 +63,13 @@ class SalaryComputeWizard(models.Model): ('contract_id.termination_date', '=', False), ('contract_id.date_end', '=', False) ]) - last_day1 = (datetime(year, month + 1, 1) - timedelta(days=1)).strftime('%Y-%m-%d') + if month == 12: + next_year = year + 1 + next_month = 1 + else: + next_year = year + next_month = month + 1 + last_day1 = (datetime(next_year, next_month, 1) - timedelta(days=1)).strftime('%Y-%m-%d') existing_employees = self.env['hr.payslip'].search([ ('date_from', '>=', first_day), ('date_to', '<=', last_day1), diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index ece977834..81a9560a1 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -639,16 +639,6 @@ parent="holiday_manage_menu_root_board" action="soong_workflow.soong_workflow_record_my_action" sequence="2"/> - - - - - - - - - -