diff --git a/yuthon_holiday/data/yuthon_holiday_data.xml b/yuthon_holiday/data/yuthon_holiday_data.xml index 2f4c53bf1..b3088c82c 100644 --- a/yuthon_holiday/data/yuthon_holiday_data.xml +++ b/yuthon_holiday/data/yuthon_holiday_data.xml @@ -7,4 +7,10 @@ 4 + + 修正编号 + yuthon_holiday_fixes_code + XZ + 4 + \ No newline at end of file diff --git a/yuthon_holiday/models/inherit_hr_leave_allocation.py b/yuthon_holiday/models/inherit_hr_leave_allocation.py index e877017d6..28d2692c8 100644 --- a/yuthon_holiday/models/inherit_hr_leave_allocation.py +++ b/yuthon_holiday/models/inherit_hr_leave_allocation.py @@ -81,7 +81,8 @@ class HrLeaveAllocation(models.Model): self.env['hr.leave.allocation'].with_context(mail_notify_force_send=False, mail_activity_automation_skip=True).create(allocation_vals) self.linked_request_ids.filtered(lambda c: c.state != 'validate').action_validate() - def button_fixes_wizard(self): + def button_fixes_approval(self): + form_id = self.env.ref('yuthon_holiday.view_yuthon_fixes_approval_form').id if self.type_request_unit == 'hour': now_type = 'hours' else: @@ -89,15 +90,15 @@ class HrLeaveAllocation(models.Model): return { "type": "ir.actions.act_window", "name": "修正申请", - "res_model": "yuthon.fixes.wizard", - "view_mode": 'form', - 'target': 'new', + "res_model": "yuthon.fixes.approval", + "views": [[form_id, "form"]], "context": { 'default_users_id': self.employee_id.user_id.id, 'default_leave_id': self.id, 'default_now_type': now_type, - } + 'default_original_days': self.number_of_days_display, + 'default_original_hours': self.number_of_days_display, + } } - diff --git a/yuthon_holiday/models/yuthon_fixes_approval.py b/yuthon_holiday/models/yuthon_fixes_approval.py index cc32f4356..d6d402403 100644 --- a/yuthon_holiday/models/yuthon_fixes_approval.py +++ b/yuthon_holiday/models/yuthon_fixes_approval.py @@ -9,7 +9,7 @@ class YuthonFixesApproval(models.Model): yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司") name = fields.Char(string="标题") - code = fields.Char(string="编号") + code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_holiday_fixes_code')) users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id) original_days = fields.Float(string="原休假时长(天)") original_hours = fields.Float(string="原休假时长(小时)") diff --git a/yuthon_holiday/views/hr_leave_batch.xml b/yuthon_holiday/views/hr_leave_batch.xml index 73629ee3b..09896c553 100644 --- a/yuthon_holiday/views/hr_leave_batch.xml +++ b/yuthon_holiday/views/hr_leave_batch.xml @@ -38,6 +38,9 @@ + + + - - - diff --git a/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml b/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml index 8dac334be..0daba141f 100644 --- a/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml +++ b/yuthon_holiday/views/inherit_hr_leave_allocation_views.xml @@ -18,7 +18,7 @@ 结束时间 -