[REM] hr_recruitment: new applicant message
Currently each new applicant creates a message on the job. This creates a lot of noise. The 'New application from ..' messages is therefore removed. The related subtype is also removed because not used anymore.
This commit is contained in:
@@ -125,13 +125,6 @@
|
||||
<field name="default" eval="False"/>
|
||||
<field name="hidden" eval="True"/>
|
||||
</record>
|
||||
<record id="mt_job_applicant_new" model="mail.message.subtype">
|
||||
<field name="name">Applicant Created</field>
|
||||
<field name="res_model">hr.job</field>
|
||||
<field name="default" eval="True"/>
|
||||
<field name="parent_id" eval="ref('mt_applicant_new')"/>
|
||||
<field name="relation_field">job_id</field>
|
||||
</record>
|
||||
<record id="mt_job_applicant_stage_changed" model="mail.message.subtype">
|
||||
<field name="name">Applicant Stage Changed</field>
|
||||
<field name="res_model">hr.job</field>
|
||||
|
||||
@@ -270,13 +270,7 @@ class Applicant(models.Model):
|
||||
vals['date_open'] = fields.Datetime.now()
|
||||
if 'stage_id' in vals:
|
||||
vals.update(self._onchange_stage_id_internal(vals.get('stage_id'))['value'])
|
||||
applicant = super(Applicant, self.with_context(mail_create_nolog=True)).create(vals)
|
||||
if applicant.job_id:
|
||||
name = applicant.partner_name if applicant.partner_name else applicant.name
|
||||
applicant.job_id.message_post(
|
||||
body=_('New application from %s') % name,
|
||||
subtype="hr_recruitment.mt_job_applicant_new")
|
||||
return applicant
|
||||
return super(Applicant, self.with_context(mail_create_nolog=True)).create(vals)
|
||||
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
@@ -293,14 +287,6 @@ class Applicant(models.Model):
|
||||
else:
|
||||
res = super(Applicant, self).write(vals)
|
||||
|
||||
# post processing: if job changed, post a message on the job
|
||||
if vals.get('job_id'):
|
||||
for applicant in self:
|
||||
name = applicant.partner_name if applicant.partner_name else applicant.name
|
||||
self.env['hr.job'].browse([vals['job_id']]).message_post(
|
||||
body=_('New application from %s') % name,
|
||||
subtype="hr_recruitment.mt_job_applicant_new")
|
||||
|
||||
# post processing: if stage changed, post a message in the chatter
|
||||
if vals.get('stage_id'):
|
||||
if self.stage_id.template_id:
|
||||
|
||||
Reference in New Issue
Block a user