Skip to content

Commit

Permalink
[IMP] website_hr_recruitment: recruitment form customization
Browse files Browse the repository at this point in the history
Add the possibility to add some fields on website recruitment form

Closes odoo#8049
  • Loading branch information
adrienpeiffer authored and beledouxdenis committed Sep 4, 2015
1 parent bd9cbdf commit 67b1be7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions addons/website_hr_recruitment/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ def jobs_apply(self, job):
'default': default,
})

def _get_applicant_char_fields(self):
return ['email_from', 'partner_name', 'description']

def _get_applicant_relational_fields(self):
return ['department_id', 'job_id']

@http.route('/jobs/thankyou', methods=['POST'], type='http', auth="public", website=True)
def jobs_thankyou(self, **post):
error = {}
Expand All @@ -110,9 +116,9 @@ def jobs_thankyou(self, **post):
'source_id' : env.ref('hr_recruitment.source_website_company').id,
'name': '%s\'s Application' % post.get('partner_name'),
}
for f in ['email_from', 'partner_name', 'description']:
for f in self._get_applicant_char_fields():
value[f] = post.get(f)
for f in ['department_id', 'job_id']:
for f in self._get_applicant_relational_fields():
value[f] = int(post.get(f) or 0)
# 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)
Expand Down

0 comments on commit 67b1be7

Please sign in to comment.