1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/appointment_hr_recruitment/models/appointment_invite.py
2024-12-10 09:04:09 +07:00

22 lines
894 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class AppointmentInviteHrRecruitment(models.Model):
_inherit = "appointment.invite"
applicant_id = fields.Many2one('hr.applicant', "Applicant",
help="Link an applicant to the appointment invite created.\n"
"Used when creating an invitation from the Meeting action in the applicant form view.")
def _get_meeting_categories_for_appointment(self):
""" Add the interview category to the meeting created if linked to an applicant
:return <calendar.event.type> recordset:
"""
categ_ids = super()._get_meeting_categories_for_appointment()
if self.applicant_id:
categ_ids += self.env.ref('hr_recruitment.categ_meet_interview', raise_if_not_found=False)
return categ_ids