diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml index ba7dc3a8b..d672ed6d4 100644 --- a/soong_workflow/views/soong_workflow_record.xml +++ b/soong_workflow/views/soong_workflow_record.xml @@ -244,7 +244,7 @@ ir.actions.act_window soong.workflow.record tree,form,search - {'search_default_group_by_group_soong_state': True,} + {'search_default_group_by_group_soong_state': True, 'search_default_group_by_group_by_workflow_id': True} [('reclaim_state', '=', False)] 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 @@ +