From 2d93c90b5c2f23e4ba1cd3c6dfe4fccf04d870f6 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: Sat, 20 Dec 2025 19:11:24 +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 --- yuthon_holiday/models/inherit_hr_leave.py | 18 +++++ yuthon_holiday/views/hr_leave_batch.xml | 4 +- yuthon_hr_attendance/models/hr_attendance.py | 21 ++--- .../models/processing_order_approval.py | 14 ++-- .../views/property_device_repair_views.xml | 1 + .../views/property_report_repair.xml | 1 + .../models/property_meter_archives.py | 2 + .../models/property_meter_water.py | 2 + .../views/property_meter_archives_views.xml | 2 + .../views/property_meter_water_views.xml | 2 + .../wizard/electric_water_wizard.py | 25 ++++++ yuthon_property/wizard/meter_price_wizard.py | 3 +- yuthon_property/wizard/water_price_wizard.py | 2 +- .../models/property_lease_contract.py | 27 +++---- .../views/property_lease_contract.xml | 20 +++-- .../models/inherit_hr_payroll_structure.py | 25 ++++-- .../inherit_hr_payroll_structure_views.xml | 3 +- yuthon_salary/wizard/yuthon_payroll_wizard.py | 79 ++++++++++++------- 18 files changed, 172 insertions(+), 79 deletions(-) diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 429e9b969..cb2c3c3e0 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -314,6 +314,8 @@ class HolidaysRequestBatch(models.Model): is_issues = fields.Boolean(string='是否上会') work_end = fields.Boolean(string="结束") issues_result = fields.Html(string="会议结果") + entrusted_agent_id = fields.Many2one('res.users', string="委托代理人") + is_entrusted = fields.Boolean(string="是否生成工作流委托") leave_by_hour = fields.Boolean(string='请假单位(小时)', default=False) leave_by_day = fields.Boolean(string='请假单位(天)', default=True) urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', @@ -357,6 +359,22 @@ class HolidaysRequestBatch(models.Model): # 提交 def action_submit(self): + if self.is_entrusted: + leave_batch_model = self.env['ir.model'].search( + [('model', '=', 'hr.leave.batch')], + limit=1 + ) + entrust_vals = { + 'model_ids': [(6, 0, [leave_batch_model.id])], + 'entrust_user_id': self.users_id.id, + 'entrust_user_id2': self.entrusted_agent_id.id, + 'is_expiration_date': True, + 'start_date': fields.Date.today(), + 'end_date': False, + 'entrust_notice': True, + } + self.env['soong.workflow.entrust'].create(entrust_vals) + self.leave_ids.action_validate() self.hour_leave_ids.action_validate() """提交请假申请,区分年假和其他假期处理""" diff --git a/yuthon_holiday/views/hr_leave_batch.xml b/yuthon_holiday/views/hr_leave_batch.xml index e9d0609e3..8487e2de7 100644 --- a/yuthon_holiday/views/hr_leave_batch.xml +++ b/yuthon_holiday/views/hr_leave_batch.xml @@ -44,6 +44,9 @@ + + + @@ -239,7 +242,6 @@ - diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 1e95b1b8b..9d6d5f671 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -814,16 +814,17 @@ class HrAttendance(models.Model): if is_executive: domain = [('current_data', '=', current_date)] attendances = self.env['hr.attendance'].search(domain) - attended_employee_ids = attendances.mapped('employee_id') - for employee in attended_employee_ids: - if is_check_in: - is_card = self.env['hr.attendance'].search([('employee_id', '=', employee.id), ('check_in', '!=', False), ('current_data', '=', current_date)], limit=1) - if not is_card: - self.card_in_comment(employee, '行政班次') - else: - is_card = self.env['hr.attendance'].search([('employee_id', '=', employee.id), ('check_out', '!=', False), ('current_data', '=', current_date)], limit=1) - if not is_card: - self.card_out_comment(employee, '行政班次') + if self._process_shift_days(current_date): # 如果是工作日则提醒 + attended_employee_ids = attendances.mapped('employee_id') + for employee in attended_employee_ids: + if is_check_in: + is_card = self.env['hr.attendance'].search([('employee_id', '=', employee.id), ('check_in', '!=', False), ('current_data', '=', current_date)], limit=1) + if not is_card: + self.card_in_comment(employee, '行政班次') + else: + is_card = self.env['hr.attendance'].search([('employee_id', '=', employee.id), ('check_out', '!=', False), ('current_data', '=', current_date)], limit=1) + if not is_card: + self.card_out_comment(employee, '行政班次') else: slot_start = datetime.combine(current_date, datetime.min.time()) slot_end = datetime.combine(current_date + timedelta(days=1), datetime.min.time()) diff --git a/yuthon_maintain/models/processing_order_approval.py b/yuthon_maintain/models/processing_order_approval.py index cfaa0c67b..b6a6f7bbd 100644 --- a/yuthon_maintain/models/processing_order_approval.py +++ b/yuthon_maintain/models/processing_order_approval.py @@ -70,13 +70,15 @@ class ProcessingOrderApproval(models.Model): name_title = fields.Char(default=_get_default_name_title) - @api.depends("company_id") + @api.depends("company_id", "repair_id", "device_id", "property_id") def _compute_name(self): - self.name = False - if self.repair_id: - self.name = self.property_id.name + '-处理单' - if self.device_id: - self.name = self.device_id.name + '-处理单' + for record in self: + if record.repair_id and record.property_id: + record.display_name = f"{record.property_id.name}-处理单" + elif record.device_id: + record.display_name = f"{record.device_id.name}-处理单" + else: + record.display_name = False @api.depends('property_id') def _compute_contract_id(self): diff --git a/yuthon_maintain/views/property_device_repair_views.xml b/yuthon_maintain/views/property_device_repair_views.xml index f4b7e1ae8..012f7271a 100644 --- a/yuthon_maintain/views/property_device_repair_views.xml +++ b/yuthon_maintain/views/property_device_repair_views.xml @@ -10,6 +10,7 @@ +