From 96cb5782a9a38da142bea5429a2788135c6d0ee0 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, 20 Apr 2026 10:24:17 +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 --- soong_workflow/models/soong_workflow_mixin.py | 5 +---- .../models/yuthon_vacation_reports.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 522e6ab86..79ab64c87 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -1437,10 +1437,7 @@ class SoongWorkflowMixin(models.AbstractModel): id_el = etree.Element("field") id_el.set("name", "log_ids") id_el.set("invisible", "1") - if self._name == "purchase.order": - # 采购订单模型:不添加 is_modify 条件 - field_inst.set("readonly", "state in %s" % readonly_arr) - else: + if readonly_arr: field_inst.set("readonly", "(state in %s) and (is_modify != True)" % readonly_arr) # if required_arr: # field_inst.set("required", "state in %s" % required_arr) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 46e7ddd4f..5b5344181 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -2040,7 +2040,7 @@ class YuthonVacationReports(models.Model): ], limit=1 # 避免多条记录,只取第一条 ) - vacation_sum1 = report_id.dynamic_previous_year1 * 8 + report_id.this_year1 * 8 if report_id else 0.0 + vacation_sum = report_id.dynamic_previous_year1 * 8 + report_id.this_year1 * 8 if report_id else 0.0 active_id = self.env['vacation.overtime.active'].search( [('employee_id', '=', emp_id), ('select_month', '=', str(last_month_first.month)), @@ -2048,11 +2048,11 @@ class YuthonVacationReports(models.Model): ('select_revoke', '!=', 'done'), ]) if active_id: - vacation_sum1 -= active_id.carry_forward_quantity + vacation_sum -= active_id.carry_forward_quantity employee_summary[emp_id] = { 'employee_id': emp_id, 'valid_date': line.valid_date, - 'vacation_sum1': vacation_sum1, + 'vacation_sum': vacation_sum, 'last_balance': report_id.dynamic_previous_year1 * 8 if report_id else 0.0, 'remainder_year': 0.0, 'carry_forward_quantity': 0.0, @@ -2118,7 +2118,7 @@ class YuthonVacationReports(models.Model): ], limit=1 # 避免多条记录,只取第一条 ) - vacation_sum1 = report_id.dynamic_previous_year1 * 8 + report_id.this_year1 * 8 if report_id else 0.0 + vacation_sum = report_id.dynamic_previous_year1 * 8 + report_id.this_year1 * 8 if report_id else 0.0 active_id = self.env['vacation.overtime.active'].search( [('employee_id', '=', emp_id), ('select_month', '=', str(last_month_first.month)), @@ -2126,11 +2126,11 @@ class YuthonVacationReports(models.Model): ('select_revoke', '!=', 'done'), ]) if active_id: - vacation_sum1 -= active_id.carry_forward_quantity + vacation_sum -= active_id.carry_forward_quantity employee_summary[emp_id] = { 'employee_id': emp_id, 'valid_date': line.valid_date, - 'vacation_sum1': vacation_sum1, + 'vacation_sum': vacation_sum, 'last_balance': report_id.dynamic_previous_year1 * 8 if report_id else 0.0, 'remainder_year': 0.0, 'carry_forward_quantity': 0.0, @@ -2200,7 +2200,7 @@ class YuthonVacationReports(models.Model): ], limit=1 # 避免多条记录,只取第一条 ) - vacation_sum1 = report_id.dynamic_previous_year1 * 8 + report_id.this_year1 * 8 if report_id else 0.0 + vacation_sum = report_id.dynamic_previous_year1 * 8 + report_id.this_year1 * 8 if report_id else 0.0 active_id = self.env['vacation.overtime.active'].search( [('employee_id', '=', emp_id), ('select_month', '=', str(last_month_first.month)), @@ -2208,11 +2208,11 @@ class YuthonVacationReports(models.Model): ('select_revoke', '!=', 'done'), ]) if active_id: - vacation_sum1 -= active_id.carry_forward_quantity + vacation_sum -= active_id.carry_forward_quantity employee_summary[emp_id] = { 'employee_id': emp_id, 'valid_date': line.valid_date, - 'vacation_sum1':vacation_sum1, + 'vacation_sum':vacation_sum, 'last_balance': report_id.dynamic_previous_year1 * 8 if report_id else 0.0, 'remainder_year': 0.0, 'carry_forward_quantity': 0.0,