[MOV] hr_recruitment_survey: split survey models into separate files

Just reordering a bit code while passing by.

Task-3093257 (Mail: The Composer Update)

Part-of: odoo/odoo#107356
This commit is contained in:
Thibault Delavallée
2023-01-27 19:56:08 +01:00
parent c60612068e
commit a166aafb36
5 changed files with 23 additions and 16 deletions
+1
View File
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from . import models
from . import wizard
@@ -3,4 +3,4 @@
from . import hr_job
from . import hr_applicant
from . import survey_invite
from . import survey_user_input
@@ -0,0 +1,17 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
class SurveyUserInput(models.Model):
_inherit = "survey.user_input"
applicant_ids = fields.One2many('hr.applicant', 'response_id', string='Applicant')
def _mark_done(self):
odoobot = self.env.ref('base.partner_root')
for user_input in self:
if user_input.applicant_ids:
body = _('The applicant "%s" has finished the survey.', user_input.applicant_ids[:1].partner_name)
user_input.applicant_ids.message_post(body=body, author_id=odoobot.id)
return super()._mark_done()
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import survey_invite
@@ -1,6 +1,6 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo import fields, models, _
from odoo.tools.misc import clean_context
@@ -26,17 +26,3 @@ class SurveyInvite(models.TransientModel):
body = '<p>%s</p>' % content
self.applicant_id.message_post(body=body)
return super().action_invite()
class SurveyUserInput(models.Model):
_inherit = "survey.user_input"
applicant_ids = fields.One2many('hr.applicant', 'response_id', string='Applicant')
def _mark_done(self):
odoobot = self.env.ref('base.partner_root')
for user_input in self:
if user_input.applicant_ids:
body = _('The applicant "%s" has finished the survey.', user_input.applicant_ids[:1].partner_name)
user_input.applicant_ids.message_post(body=body, author_id=odoobot.id)
return super()._mark_done()