[FIX] hr_recruitment: set job recruiter on applicantion recruiter

If a job position has a default recruiter, when applying for this job, the application's recruiter is not the correct one.

To reproduce the error:
	(Need hr_recruitment,website_hr_recruitment)
	1. Go to Recruitment > Configuration > Job Positions
	2. Create a new one
		- Fill in the Recruiter field
	3. Save it
	4. Click on "Go to Website"
	5. Publish the job position
		- Top bar: click on "Unpublished"
	6. Log out
	7. Go back on the job position page
	8. Apply
	9. Log in
	10. Open the Recruitment module
	11. Check the applications for the job position

=> The application is created, but the associated recruiter is not the one previously set (step 2 above).

This fix makes sure an application has the correct recruiter when the associated job position recruiter is defined.

OPW-2387888

closes odoo/odoo#62038

X-original-commit: b7deda4185e3c240c3c30c9a570dc7173f9d8aa3
Signed-off-by: adwid <adwid@users.noreply.github.com>
This commit is contained in:
Adrien Widart
2020-11-19 17:17:07 +00:00
parent 0329217db5
commit 1902096b8e
@@ -115,7 +115,7 @@ class Applicant(models.Model):
company_id = fields.Many2one('res.company', "Company", compute='_compute_company', store=True, readonly=False, tracking=True)
user_id = fields.Many2one(
'res.users', "Recruiter", compute='_compute_user',
tracking=True, default=lambda self: self.env.uid, store=True, readonly=False)
tracking=True, store=True, readonly=False)
date_closed = fields.Datetime("Closed", compute='_compute_date_closed', store=True, index=True)
date_open = fields.Datetime("Assigned", readonly=True, index=True)
date_last_stage_update = fields.Datetime("Last Stage Update", index=True, default=fields.Datetime.now)