[FIX] (website_)hr_recruitment: correct version of

659db669aa
This commit is contained in:
Richard Mathot
2014-10-20 17:35:33 +02:00
parent ad48bf6d7d
commit e829047015
2 changed files with 8 additions and 10 deletions
-7
View File
@@ -422,13 +422,6 @@ class hr_applicant(osv.Model):
cr, uid, [applicant.job_id.id],
body=_('New application from %s') % name,
subtype="hr_recruitment.mt_job_applicant_new", context=context)
self.message_post(
cr, uid, [applicant.id],
body = _("%s's Application \n From: %s \n\n %s \n") % (name, vals.get('email_from') or "", vals.get('description',"") or ""),
attachments = context.get('attachments'),
content_subtype = 'plaintext',
subtype = "hr_recruitment.mt_applicant_hired",
context = context)
return obj_id
def write(self, cr, uid, ids, vals, context=None):
@@ -117,9 +117,14 @@ class website_hr_recruitment(http.Controller):
# Retro-compatibility for saas-3. "phone" field should be replace by "partner_phone" in the template in trunk.
value['partner_phone'] = post.pop('phone', False)
attachment = []
applicant = env['hr.applicant'].create(value)
if post['ufile']:
attachment.append((post['ufile'].filename, post['ufile'].read()))
env['hr.applicant'].with_context(attachments = attachment).create(value)
name = applicant.partner_name if applicant.partner_name else applicant.name
applicant.message_post(
body = _("%s's Application \n From: %s \n\n %s \n") % (name, applicant.email_from or "", applicant.description or ""),
attachments = [(post['ufile'].filename, post['ufile'].read())],
content_subtype = 'plaintext',
subtype = "hr_recruitment.mt_applicant_hired")
return request.render("website_hr_recruitment.thankyou", {})