[FIX] hr_recruitment: missing attachments in email template

When switching an applicant to another stage,
there is the possibility to send an email template,
according to the given stage.

The attachments defined in the email templates should
be sent as well.

opw-630768
This commit is contained in:
Denis Ledoux
2015-03-24 15:10:55 +01:00
parent 940a0e45d4
commit ccfdca99fb
+5 -4
View File
@@ -468,12 +468,13 @@ class hr_applicant(osv.Model):
'post': True,
'notify': True,
}, context=compose_ctx)
values = self.pool['mail.compose.message'].onchange_template_id(
cr, uid, [compose_id], stage.template_id.id, 'mass_mail', self._name, False, context=compose_ctx)['value']
if values.get('attachment_ids'):
values['attachment_ids'] = [(6, 0, values['attachment_ids'])]
self.pool['mail.compose.message'].write(
cr, uid, [compose_id],
self.pool['mail.compose.message'].onchange_template_id(
cr, uid, [compose_id],
stage.template_id.id, 'mass_mail', self._name, False,
context=compose_ctx)['value'],
values,
context=compose_ctx)
self.pool['mail.compose.message'].send_mail(cr, uid, [compose_id], context=compose_ctx)
return res