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):
# 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", {})