# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import http, _ from odoo.addons.website.models.website import slug from odoo.http import request # NB: DO NOT FORWARD PORT THE FALSY LEAVES IN 11.0 class WebsiteHrRecruitment(http.Controller): @http.route([ '/jobs', '''/jobs/country//department/', '''/jobs/country//department/', type='http', auth="public", website=True) def jobs_detail(self, job, **kwargs): return request.render("website_hr_recruitment.detail", { 'job': job, 'main_object': job, }) @http.route('/jobs/apply/', type='http', auth="public", website=True) def jobs_apply(self, job, **kwargs): error = {} default = {} if 'website_hr_recruitment_error' in request.session: error = request.session.pop('website_hr_recruitment_error') default = request.session.pop('website_hr_recruitment_default') return request.render("website_hr_recruitment.apply", { 'job': job, 'error': error, 'default': default, })