diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 87e584576..1cab37a02 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -1407,7 +1407,6 @@ class SoongWorkflowLine(models.Model): create_uid = fields.Many2one(related="workflow_record_id.create_uid", string="创建人") write_date2 = fields.Datetime(related="workflow_record_id.write_date2", string="最后更新日期") - def unlink(self): if not self.env.context.get('confirm_delete'): # 提示用户确认删除 diff --git a/yuthon_holiday/models/inherit_hr_leave.py b/yuthon_holiday/models/inherit_hr_leave.py index 131d0f8ca..dbeb9d598 100644 --- a/yuthon_holiday/models/inherit_hr_leave.py +++ b/yuthon_holiday/models/inherit_hr_leave.py @@ -605,13 +605,10 @@ class HolidaysRequestBatch(models.Model): def _create_other_leave_line(self, period_start, leave_data, days, period, leave_type_name): holiday_type = self.env['hr.leave.type'].search([('name', '=', leave_type_name)], limit=1) - report_month = date(period_start.year, period_start.month, 1) - month_end = date(period_start.year, period_start.month, - calendar.monthrange(period_start.year, period_start.month)[1]) + first_day = fields.Date.today().replace(day=1) vacation_report = self.env['yuthon.vacation.reports'].search([ ('employee_id', '=', self.users_id.employee_ids.id), - ('vacation_date', '>=', fields.Date.to_string(report_month)), - ('vacation_date', '<=', fields.Date.to_string(month_end)) + ('vacation_date', '=', first_day), ], limit=1) existing_leave_line = self.env['vacation.other.line'].search([ ('employee_id', '=', self.users_id.employee_ids.id),