From 67fe77e0af3e2d827b594b64754f55251e708658 Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Fri, 14 Mar 2025 14:23:33 +0800 Subject: [PATCH] =?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 --- room/__manifest__.py | 2 +- room/models/room_booking.py | 27 ++++++++++++++----- yuthon_hr_employee_approval/__manifest__.py | 1 + .../models/__init__.py | 1 + .../models/inherit_hr_applicant.py | 4 +-- .../models/inherit_room_booking.py | 10 +++++++ .../views/inherit_hr_job_views.xml | 7 ----- .../views/inherit_room_booking_views.xml | 19 +++++++++++++ .../yuthon_recruitment_approval_views.xml | 3 +++ yuthon_issue/views/inherit_room_booking.xml | 2 +- yuthon_work_brand/views/hr_menus.xml | 16 +++++------ 11 files changed, 66 insertions(+), 26 deletions(-) create mode 100644 yuthon_hr_employee_approval/models/inherit_room_booking.py create mode 100644 yuthon_hr_employee_approval/views/inherit_room_booking_views.xml diff --git a/room/__manifest__.py b/room/__manifest__.py index 573d18ddb..01b7766c0 100644 --- a/room/__manifest__.py +++ b/room/__manifest__.py @@ -7,7 +7,7 @@ 'description': 'Experience the Ease of Booking Meeting Rooms with Real-Time Availability Display.', 'category': 'Services/Room', 'version': '1.0', - 'depends': ['mail', 'hr', 'documents', 'yuthon_wechat', 'fleet', 'calendar', 'yuthon_hr_employee'], + 'depends': ['mail', 'hr', 'documents', 'yuthon_wechat', 'fleet', 'calendar'], 'data': [ 'data/message_template_views.xml', 'data/room_wechat_cron_data.xml', diff --git a/room/models/room_booking.py b/room/models/room_booking.py index d08ea9533..115070fcd 100644 --- a/room/models/room_booking.py +++ b/room/models/room_booking.py @@ -124,13 +124,13 @@ class RoomBooking(models.Model): 'sign_type': 'no', }) # 缺少逻辑 - for external in self.other_user_ids: - self.env['room.meeting.sign'].create({ - 'room_booking_id': self.id, - 'partner_name': external.name, - 'user_type': 'outsiders', - 'sign_type': 'no', - }) + # for external in self.other_user_ids: + # self.env['room.meeting.sign'].create({ + # 'room_booking_id': self.id, + # 'partner_name': external.name, + # 'user_type': 'outsiders', + # 'sign_type': 'no', + # }) event = self.env['calendar.event'].create({ 'name': self.name, @@ -142,6 +142,19 @@ class RoomBooking(models.Model): 'event_id': event.id, 'partner_id': partner.address_id.id, }) + task_type = self.env['task.type.setting'].search([('name', '=', '面试')]) + employee_records = self.env['hr.employee'].search([('user_id', 'in', self.room_users_ids.ids)]) + if not task_type: + task_type = self.env['task.type.setting'].create({ + 'name': '面试', + }) + self.env['yuthon.will.task'].create({ + 'start_time': self.start_datetime, + 'task_type':task_type.id, + 'employee_ids': [(6, 0, employee_records.ids)], + 'state':'will', + 'task_content': '面试安排' + }) # 企业用户发送通知 partner_ids = self.sudo().env['res.users'].search([('id', 'in', self.room_users_ids.ids)]).mapped( 'partner_id').ids diff --git a/yuthon_hr_employee_approval/__manifest__.py b/yuthon_hr_employee_approval/__manifest__.py index fc98ef722..78d3a26c7 100644 --- a/yuthon_hr_employee_approval/__manifest__.py +++ b/yuthon_hr_employee_approval/__manifest__.py @@ -19,6 +19,7 @@ 'data/stage_approval_data.xml', 'data/tage_approval_data.xml', 'views/inherit_hr_applicant_views.xml', + 'views/inherit_room_booking_views.xml', 'views/inherit_hr_job_views.xml', 'views/inherit_hr_employee_views.xml', 'views/yuthon_message_login_views.xml', diff --git a/yuthon_hr_employee_approval/models/__init__.py b/yuthon_hr_employee_approval/models/__init__.py index 05cb1dfb5..c47bca161 100644 --- a/yuthon_hr_employee_approval/models/__init__.py +++ b/yuthon_hr_employee_approval/models/__init__.py @@ -1,6 +1,7 @@ from . import inherit_hr_employee from . import hr_employee_page from . import inherit_hr_job +from . import inherit_room_booking from . import inherit_hr_applicant from . import yuthon_message_login from . import yuthon_onboard_approval diff --git a/yuthon_hr_employee_approval/models/inherit_hr_applicant.py b/yuthon_hr_employee_approval/models/inherit_hr_applicant.py index 8eea73709..2f40a91d8 100644 --- a/yuthon_hr_employee_approval/models/inherit_hr_applicant.py +++ b/yuthon_hr_employee_approval/models/inherit_hr_applicant.py @@ -68,8 +68,8 @@ class HrApplicant(models.Model): form_id = self.env.ref("yuthon_hr_employee_approval.yuthon_onboard_approval_form").id information_id = self.env["yuthon.message.login"].search([('staff_name', '=', self.partner_name)]) recruitment_id = self.env["yuthon.recruitment.approval"].search([('name', 'ilike', self.name), ('name', 'ilike', self.department_id.name)]) - for user in self.interview_approval_ids: - if user.interview_stage_id.name == '未通过': + for applicant in self: + if applicant.stage_id.name != '待入职': raise UserError('当前人员不允许入职') return { 'type': 'ir.actions.act_window', diff --git a/yuthon_hr_employee_approval/models/inherit_room_booking.py b/yuthon_hr_employee_approval/models/inherit_room_booking.py new file mode 100644 index 000000000..bed6b9ce2 --- /dev/null +++ b/yuthon_hr_employee_approval/models/inherit_room_booking.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, _ +import datetime + + + +class RoomBooking(models.Model): + _inherit = "room.booking" + + interview_id = fields.Many2one("yuthon.interview.approval", string="关联面试流程", tracking=1) \ No newline at end of file diff --git a/yuthon_hr_employee_approval/views/inherit_hr_job_views.xml b/yuthon_hr_employee_approval/views/inherit_hr_job_views.xml index 805b87c8f..b47f209e0 100644 --- a/yuthon_hr_employee_approval/views/inherit_hr_job_views.xml +++ b/yuthon_hr_employee_approval/views/inherit_hr_job_views.xml @@ -19,17 +19,10 @@ hr.job -
- -
1
- - - [('is_pub','=',True)] - diff --git a/yuthon_hr_employee_approval/views/inherit_room_booking_views.xml b/yuthon_hr_employee_approval/views/inherit_room_booking_views.xml new file mode 100644 index 000000000..4d390f3cb --- /dev/null +++ b/yuthon_hr_employee_approval/views/inherit_room_booking_views.xml @@ -0,0 +1,19 @@ + + + + inherit.room.booking.approval.tree + room.booking + + + + + + + + + 面试会议安排 + room.booking + tree,form + [('meeting_type_id.name','=','面试')] + + \ No newline at end of file diff --git a/yuthon_hr_employee_approval/views/yuthon_recruitment_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_recruitment_approval_views.xml index 68d7125f3..570133e6f 100644 --- a/yuthon_hr_employee_approval/views/yuthon_recruitment_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_recruitment_approval_views.xml @@ -17,6 +17,9 @@
+
+
- + diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index 46a58f554..b031dc5b7 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -22,16 +22,11 @@ parent="hr_recruitment_menu_root_board" action="hr_recruitment.action_hr_job" sequence="5"/> - + sequence="10"/> @@ -42,10 +37,15 @@ parent="hr_recruitment_menu_root_board" action="yuthon_hr_employee_approval.yuthon_message_login_action" sequence="15"/> + + sequence="30"/>