From 1902096b8edda66dcae0fb4162a10e23befcdf29 Mon Sep 17 00:00:00 2001 From: Adrien Widart Date: Thu, 19 Nov 2020 08:14:13 +0000 Subject: [PATCH] [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 --- addons/hr_recruitment/models/hr_recruitment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py index 79d0329dd00..faa6650cab9 100644 --- a/addons/hr_recruitment/models/hr_recruitment.py +++ b/addons/hr_recruitment/models/hr_recruitment.py @@ -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)