From 6e18a3cfdc5639b100ee1fbdc082df1398ae66ba 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: Tue, 23 Dec 2025 15:28:42 +0800 Subject: [PATCH 1/2] =?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 | 12 +++++++++++- yuthon_purchase/models/inherit_purchase_order.py | 3 ++- .../views/inherit_purchase_order_views.xml | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 41be3fe6d..9f164dab5 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -674,9 +674,19 @@ class YuthonVacationReports(models.Model): 'vacation_date': current_month_first, }) - def _update_leave_lines(self, report, allocations, number_of_hours_display): for alloc in allocations: + existing_line = self.env['vacation.leave.line'].search([ + ('vacation_id', '=', report.id), + ('employee_id', '=', report.employee_id.id), + ('update_type', '=', 'add'), + ('allocation_type', '=', 'allocation'), + ('text', '=', "上月额度继承"), + ('update_lines', '=', number_of_hours_display), + ('is_void', '=', False) + ], limit=1) + if existing_line: + continue self.env['vacation.leave.line'].create({ 'vacation_id': report.id, 'employee_id': report.employee_id.id, diff --git a/yuthon_purchase/models/inherit_purchase_order.py b/yuthon_purchase/models/inherit_purchase_order.py index 2c31af2ce..e2d67aab7 100644 --- a/yuthon_purchase/models/inherit_purchase_order.py +++ b/yuthon_purchase/models/inherit_purchase_order.py @@ -7,13 +7,14 @@ from odoo.exceptions import UserError, ValidationError class InheritPurchaseOrder(models.Model): # _inherit = 'purchase.order' _name = 'purchase.order' - _inherit = ['purchase.order','sun.badge.menu.mixin'] + _inherit = ['purchase.order', 'soong.workflow.mixin'] json_display = fields.Char( string="物品详情", compute='_compute_json_display', store=True ) + work_end = fields.Boolean(string="结束") document_ids = fields.Many2many('ir.attachment', string="附件") diff --git a/yuthon_purchase/views/inherit_purchase_order_views.xml b/yuthon_purchase/views/inherit_purchase_order_views.xml index 7db1929f8..4245824ab 100644 --- a/yuthon_purchase/views/inherit_purchase_order_views.xml +++ b/yuthon_purchase/views/inherit_purchase_order_views.xml @@ -29,6 +29,8 @@ + + [('is_employee', '=', False)] From 126bf7ddf8a0b74c7840217fc60abb5a923957f6 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: Tue, 23 Dec 2025 15:35:57 +0800 Subject: [PATCH 2/2] =?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 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 9f164dab5..502e86212 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -677,11 +677,11 @@ class YuthonVacationReports(models.Model): def _update_leave_lines(self, report, allocations, number_of_hours_display): for alloc in allocations: existing_line = self.env['vacation.leave.line'].search([ + ('workflow_record_id', '=', False), ('vacation_id', '=', report.id), ('employee_id', '=', report.employee_id.id), ('update_type', '=', 'add'), ('allocation_type', '=', 'allocation'), - ('text', '=', "上月额度继承"), ('update_lines', '=', number_of_hours_display), ('is_void', '=', False) ], limit=1) @@ -701,6 +701,19 @@ class YuthonVacationReports(models.Model): def _update_over_lines(self, report, allocations, number_of_hours_display): """更新补休明细行""" for alloc in allocations: + existing_line = self.env['vacation.leave.line'].search([ + ('workflow_record_id', '=', False), + ('vacation_id', '=', report.id), + ('employee_id', '=', report.employee_id.id), + ('update_type', '=', 'add'), + ('allocation_type', '=', 'allocation'), + ('workday', '=', number_of_hours_display), + ('legal_day', '=', 0), + ('public_holidays', '=', 0), + ('meal_number', '=', 0), + ], limit=1) + if existing_line: + continue self.env['vacation.over.line'].create({ 'vacation_id': report.id, 'employee_id': report.employee_id.id,