diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-03-24 15:08:43 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-03-24 15:10:55 +0100 |
| commit | ccfdca99fb7dd6947e8b31d79c71d2bb8aae9aa4 (patch) | |
| tree | ee903d4b40ce42ff5af3268904818ef1970b80b6 | |
| parent | 940a0e45d40b83a8b49a50ec823bdac808ae6fc8 (diff) | |
[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
| -rw-r--r-- | addons/hr_recruitment/hr_recruitment.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index ec564bcbaee..6721002e228 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -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 |
