Debian Codegraph @

addons/hr_recruitment_survey/models/survey_user_input.py

raw symbols SCIP
1 # Part of Odoo. See LICENSE file for full copyright and licensing details.
2
3 from odoo import fields, models, _
4
5
6 class SurveyUser_Input(models.Model):
7 _inherit = "survey.user_input"
8
9 applicant_id = fields.Many2one('hr.applicant', string='Applicant', index='btree_not_null')
10
11 def _mark_done(self):
12 odoobot = self.env.ref('base.partner_root')
13 for user_input in self:
14 if user_input.applicant_id:
15 body = _('The applicant "%s" has finished the survey.', user_input.applicant_id.partner_name)
16 user_input.applicant_id.message_post(body=body, author_id=odoobot.id)
17 return super()._mark_done()