Skip to content
Snippets Groups Projects
Commit abb3afc0 authored by Thomas Lefebvre (thle)'s avatar Thomas Lefebvre (thle)
Browse files

[FIX] website_hr_recruitment: apply for an unpublished job internally

Issue:
------
Since the commit [^1], it was no longer possible to apply for a job
via the website if it is unpublished.
This made it impossible to apply for internal job offers.

Solution:
---------
Since the commit [^2], it is possible to distinguish
between unpublished and archived job offers.

The behavior after this commit is as follows:

- if the job is published --> everybody can apply;
- if the job is not published --> everybody can apply but the job page is hidden;
    We need to know it, i.e. for internal use only.
- if the job is archived --> nobody can apply;
    There is an error message "the job offer has been closed".

[^1]: https://github.com/odoo/odoo/commit/72072263ae01a8bea01c7fead000159ae9d060d2
[^2]: https://github.com/odoo/odoo/commit/6c5f38ae37e9c1014bfa93dd82ffc6a3b31f0bd5



opw-3508043

closes odoo/odoo#135654

Signed-off-by: default avatarSofie Gvaladze (sgv) <sgv@odoo.com>
parent a52fc1db
Branches
Tags
No related merge requests found
......@@ -723,7 +723,7 @@ msgstr ""
#. odoo-python
#: code:addons/website_hr_recruitment/models/hr_recruitment.py:0
#, python-format
msgid "You cannot apply for this job."
msgid "The job offer has been closed."
msgstr ""
#. module: website_hr_recruitment
......
......@@ -35,8 +35,8 @@ class Applicant(models.Model):
values.setdefault('name', name)
if values.get('job_id'):
job = self.env['hr.job'].browse(values.get('job_id'))
if not job.sudo().website_published:
raise UserError(_("You cannot apply for this job."))
if not job.sudo().active:
raise UserError(_("The job offer has been closed."))
stage = self.env['hr.recruitment.stage'].sudo().search([
('fold', '=', False),
'|', ('job_ids', '=', False), ('job_ids', '=', values['job_id']),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment