From 137dc00fa108ce1305fb58372ecc5e5c49c1a0fd 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: Wed, 21 Jan 2026 18:34:03 +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 --- soong_workflow/models/soong_workflow_mixin.py | 2 +- .../models/hr_attendance_detail_wechat.py | 4 +- .../models/yuthon_vacation_reports.py | 43 +++++++++++++++---- .../static/src/js/button_vacation_put.js | 38 ++++++++-------- .../static/src/xml/button_vacation_put.xml | 12 +++--- .../views/yuthon_vacation_reports_views.xml | 21 +++++++++ .../wizard/pay_carryover_wizard.py | 18 ++------ .../wizard/pay_carryover_wizard_views.xml | 3 +- .../wizard/vacation_confirm_wizard.py | 10 +---- .../wizard/vacation_confirm_wizard_views.xml | 2 +- .../wizard/vacation_put_wizard.py | 14 +----- .../wizard/vacation_put_wizard_views.xml | 2 +- 12 files changed, 95 insertions(+), 74 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 362393236..84b9c566d 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -452,7 +452,7 @@ class SoongWorkflowMixin(models.AbstractModel): # 筛选与当前节点部门匹配的后续节点 valid_nodes = [] for link in current_node.out_link_ids: - if self.name_title in ['业务审批', '会审意见表', '信息发布申请表',]: + if self.name_title in ['业务审批', '汇审意见表', '信息发布申请表',]: category_names = self.information_categories_ids.mapped('name') target_name = link.name.split('->')[-1].strip() if '工会活动' in category_names: diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index b52e2a806..69aec3cdf 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -98,7 +98,9 @@ class HrAttendanceDetail(models.Model): def create(self, vals): record = super(HrAttendanceDetail, self).create(vals) if record.employee_id.name != '龙春球': - if record.employee_id and record.checkin_time and record.source == 'iot': + resource_user_ids = record.employee_id.resource_calendar_id.resource_user_ids.ids + is_resource_user = True if record.employee_id.id in resource_user_ids else False + if record.employee_id and record.checkin_time and record.source == 'iot' and not is_resource_user: employee_id = record.employee_id checkin_datetime = record.checkin_time current_data = record.checkin_time.date() + timedelta(hours=8) diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py index 87f35b4ce..54f51d73e 100644 --- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py +++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py @@ -508,14 +508,20 @@ class YuthonVacationReports(models.Model): } } - def all_put(self): + vacation_ids = self.env["yuthon.vacation.reports"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + vacation_list = [] + for rec in vacation_ids: + vacation_list.append(rec.id) return { 'type': 'ir.actions.act_window', 'name': '批量发送确认弹窗', 'res_model': 'vacation.put.wizard', 'view_mode': 'form', 'target': 'new', + 'context': {'default_vacation_ids': [(6, 0, [vacation_list])] + } } @@ -724,7 +730,6 @@ class YuthonVacationReports(models.Model): record.statutory_leave = legal_total/8 record.cop_leave = total_add2 / 8 - @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: @@ -738,14 +743,34 @@ class YuthonVacationReports(models.Model): record.meal_fee = meal_total def all_confirm(self): + vacation_ids = self.env["yuthon.vacation.reports"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + vacation_list = [] + for rec in vacation_ids: + vacation_list.append(rec.id) return { - 'name': '批量确认弹窗', - 'type': 'ir.actions.act_window', - 'res_model': 'vacation.confirm.wizard', - 'view_mode': 'form', - 'target': 'new', + 'name': '批量确认弹窗', + 'type': 'ir.actions.act_window', + 'res_model': 'vacation.confirm.wizard', + 'view_mode': 'form', + 'target': 'new', + 'context': {'default_vacation_ids': [(6, 0, vacation_list)]}, + } - } + def all_carryover(self): + vacation_ids = self.env["yuthon.vacation.reports"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + vacation_list = [] + for rec in vacation_ids: + vacation_list.append(rec.id) + return { + 'name': '加班结转', + 'type': 'ir.actions.act_window', + 'res_model': 'pay.carryover.wizard', + 'view_mode': 'form', + 'target': 'new', + 'context': {'default_vacation_ids': [(6, 0, vacation_list)]}, + } # 自动确认考勤台账(上个月) def automatic_confirmation(self): @@ -1330,6 +1355,8 @@ class VacationOtherLine(models.Model): 'view_mode': 'form', } + + class AttendanceMessageLog(models.Model): _name = 'attendance.message.log' _description = '消息提醒日志' diff --git a/yuthon_hr_attendance/static/src/js/button_vacation_put.js b/yuthon_hr_attendance/static/src/js/button_vacation_put.js index 26329d388..bb3774b4c 100644 --- a/yuthon_hr_attendance/static/src/js/button_vacation_put.js +++ b/yuthon_hr_attendance/static/src/js/button_vacation_put.js @@ -6,43 +6,43 @@ import { listView } from '@web/views/list/list_view'; export class CustomAttendanceVacationPutController extends ListController { setup() { super.setup(); - } - openVacationPutWizard() { + } + openHrLeaveWizard() { this.actionService.doAction({ type: 'ir.actions.act_window', - res_model: 'vacation.put.wizard', - name: '批量发送确认弹窗', - view_mode: 'form', + res_model: 'hr.leave', + name: '请假情况', + view_mode: 'tree', view_type: 'form', - views: [[false, 'form']], - target: 'new', // 以弹窗形式打开 + views: [["yuthon_hr_attendance.view_hr_leave_statement_tree", 'tree']], + target: 'new', // 弹窗形式打开 context: {}, }); } - openVacationConfirmWizard(){ + openVacationOverWizard() { this.actionService.doAction({ type: 'ir.actions.act_window', - res_model: 'vacation.confirm.wizard', - name: '批量确认弹窗', - view_mode: 'form', + res_model: 'vacation.over.line', + name: '加班情况', + view_mode: 'tree', view_type: 'form', - views: [[false, 'form']], - target: 'new', // 以弹窗形式打开 + views: [[false, 'tree']], + target: 'new', context: {}, }); } - openPayCarryoverWizard(){ + openYuthonVacationWizard() { this.actionService.doAction({ type: 'ir.actions.act_window', - res_model: 'pay.carryover.wizard', - name: '加班费结转弹窗', - view_mode: 'form', + res_model: 'yuthon.vacation.reports', + name: '误餐情况', + view_mode: 'tree', view_type: 'form', - views: [[false, 'form']], - target: 'new', // 以弹窗形式打开 + views: [[false, 'tree']], + target: 'new', context: {}, }); } diff --git a/yuthon_hr_attendance/static/src/xml/button_vacation_put.xml b/yuthon_hr_attendance/static/src/xml/button_vacation_put.xml index 7586f0994..993552bae 100644 --- a/yuthon_hr_attendance/static/src/xml/button_vacation_put.xml +++ b/yuthon_hr_attendance/static/src/xml/button_vacation_put.xml @@ -2,18 +2,18 @@ - - - diff --git a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml index a2ca91af3..5c3bc11af 100644 --- a/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml +++ b/yuthon_hr_attendance/views/yuthon_vacation_reports_views.xml @@ -605,6 +605,27 @@ code action = model.vacation_delete() + + 发送确认提醒 + + + code + action = model.all_put() + + + 批量确认 + + + code + action = model.all_confirm() + + + 加班费结转 + + + code + action = model.all_carryover() + 管理员确认 diff --git a/yuthon_hr_attendance/wizard/pay_carryover_wizard.py b/yuthon_hr_attendance/wizard/pay_carryover_wizard.py index 7e93bc408..2b3fecf76 100644 --- a/yuthon_hr_attendance/wizard/pay_carryover_wizard.py +++ b/yuthon_hr_attendance/wizard/pay_carryover_wizard.py @@ -15,23 +15,11 @@ class PayCarryoverWizard(models.TransientModel): _name = 'pay.carryover.wizard' _description = '加班费结转' - select_time = fields.Selection([('1', '一月'), ('2', '二月'), ('3', '三月'), ('4', '四月'), - ('5', '五月'), ('6', '六月'), ('7', '七月'), ('8', '八月'), - ('9', '九月'), ('10', '十月'), ('11', '十一月'), - ('12', '十二月')], string='选择月份', - default=lambda self: self._get_default_month()) - select_year = fields.Selection(selection=[(str(i), str(i)) for i in range(2024, 2060)], string='选择年份', - default=lambda self: str(datetime.now().year)) + vacation_ids = fields.Many2many('yuthon.vacation.reports', string='假期') def action_confirm(self): - year = int(self.select_year) - month = int(self.select_time) - vacation_date = datetime(year, month, 1).date() - reports = self.env["yuthon.vacation.reports"].search([('vacation_date', '=', vacation_date), - ('company_id.name', '=', '集团本部') - ]) - is_2025_december = (year == 2026 and month == 1) - for rec in reports: + for rec in self.vacation_ids: + is_2025_december = rec.vacation_date.year == 2026 and rec.vacation_date.month == 1 if rec.overtime_ids: for overtime in rec.overtime_ids: if overtime.text == '上月额度继承' and overtime.workday > 40: diff --git a/yuthon_hr_attendance/wizard/pay_carryover_wizard_views.xml b/yuthon_hr_attendance/wizard/pay_carryover_wizard_views.xml index 958abc55a..95b8ef592 100644 --- a/yuthon_hr_attendance/wizard/pay_carryover_wizard_views.xml +++ b/yuthon_hr_attendance/wizard/pay_carryover_wizard_views.xml @@ -6,8 +6,7 @@
- - +