diff --git a/yuthon_holiday/models/yuthon_vacation_reports.py b/yuthon_holiday/models/yuthon_vacation_reports.py index ab0b0f71b..5126a2aab 100644 --- a/yuthon_holiday/models/yuthon_vacation_reports.py +++ b/yuthon_holiday/models/yuthon_vacation_reports.py @@ -6,7 +6,7 @@ from odoo.exceptions import ValidationError class YuthonVacationReports(models.Model): _name = 'yuthon.vacation.reports' - _description = '假期报表' + _description = '假期额度记录' employee_id = fields.Many2one('hr.employee', string='员工') company_id = fields.Many2one(related="employee_id.company_id", string="公司") @@ -131,7 +131,7 @@ class VacationLeaveLine(models.Model): _name = 'vacation.leave.line' _description = '年假明细' - vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期报表') + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期额度记录') workflow_record_id = fields.Many2one('soong.workflow.record', string='流程') update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型') update_date = fields.Date(string='更新时间') @@ -161,7 +161,7 @@ class VacationOverline(models.Model): _name = 'vacation.over.line' _description = '加班明细' - vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期报表') + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期额度记录') workflow_record_id = fields.Many2one('soong.workflow.record', string='流程') update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型') workday = fields.Float(string='工作日') @@ -207,7 +207,7 @@ class VacationMealLine(models.Model): _name = 'vacation.meal.line' _description = '误餐明细' - vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期报表') + vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期额度记录') workflow_record_id = fields.Many2one('soong.workflow.record', string='流程') update_type= fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型') update_date = fields.Date(string='更新时间') diff --git a/yuthon_holiday/security/yuthon_holiday_group.xml b/yuthon_holiday/security/yuthon_holiday_group.xml index ad309f170..eea6b9581 100644 --- a/yuthon_holiday/security/yuthon_holiday_group.xml +++ b/yuthon_holiday/security/yuthon_holiday_group.xml @@ -14,7 +14,7 @@ - 假期报表多公司 + 假期额度记录多公司 [('company_id', 'in', company_ids)] diff --git a/yuthon_holiday/views/yuthon_vacation_reports_views.xml b/yuthon_holiday/views/yuthon_vacation_reports_views.xml index 7cbaf765e..1666d919e 100644 --- a/yuthon_holiday/views/yuthon_vacation_reports_views.xml +++ b/yuthon_holiday/views/yuthon_vacation_reports_views.xml @@ -4,7 +4,7 @@ yuthon.vacation.reports.tree yuthon.vacation.reports - + @@ -19,7 +19,7 @@ yuthon.vacation.reports.form yuthon.vacation.reports -
+ @@ -70,10 +70,16 @@ - 假期报表 + 假期额度记录 yuthon.vacation.reports tree,form + + 我的假期额度 + yuthon.vacation.reports + tree,form + [('employee_id.user_id', '=', uid)] + 更新报表 diff --git a/yuthon_hr_attendance/models/hr_attendance.py b/yuthon_hr_attendance/models/hr_attendance.py index 1cbc2b83d..affbacee1 100644 --- a/yuthon_hr_attendance/models/hr_attendance.py +++ b/yuthon_hr_attendance/models/hr_attendance.py @@ -51,9 +51,21 @@ class HrAttendance(models.Model): approval_check_in = fields.Datetime(string="修正前上班打卡时间") approval_check_out = fields.Datetime(string="修正前下班打卡时间") + is_workflow = fields.Boolean(string="是否是流程", default=False) + workflow_id = fields.Many2one('soong.workflow.record', string="流程", compute='_compute_workflow', store=True) is_month = fields.Boolean(string="是否为本月数据", compute='_compute_month_status', store=True) is_last_month = fields.Boolean(string="是否为上月数据", compute='_compute_month_status', store=True) + def button_workflow(self): + self.ensure_one() + return { + 'name': '流程', + 'type': 'ir.actions.act_window', + 'view_mode': 'tree', + 'res_model': 'soong.workflow.record', + 'domain': [('id', '=', self.workflow_id.id)], + } + @api.depends('current_data') def _compute_month_status(self): today = fields.Date.today() diff --git a/yuthon_hr_attendance/views/hr_attendance_views.xml b/yuthon_hr_attendance/views/hr_attendance_views.xml index 21c4704ce..32d975f34 100644 --- a/yuthon_hr_attendance/views/hr_attendance_views.xml +++ b/yuthon_hr_attendance/views/hr_attendance_views.xml @@ -6,6 +6,7 @@
@@ -33,9 +34,12 @@ + +