From 8d1918d82cd189e78e434f78e43d73d4e165bb08 Mon Sep 17 00:00:00 2001 From: shivam shah Date: Tue, 18 Aug 2020 03:31:17 +0000 Subject: [PATCH] [FIX] hr_recruitment: Fix traceback on applicant quick create Currently, when got to applicant view and quick create the applicant in the kanban view there is traceback for department_id. becasue department_id is computed field which depends on job_id and it was not set as False due to filter on self. So in this commit, If job_id is not there then department_id should be set as False. closes odoo/odoo#56796 Taskid: 2320885 X-original-commit: 2ec35b724e5ac985a4baef85b96dc3411a828762 Signed-off-by: Yannick Tivisse (yti) --- 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 321e4340ca6..c757ce15643 100644 --- a/addons/hr_recruitment/models/hr_recruitment.py +++ b/addons/hr_recruitment/models/hr_recruitment.py @@ -230,7 +230,7 @@ class Applicant(models.Model): @api.depends('job_id') def _compute_department(self): - for applicant in self.filtered(lambda a: a.job_id): + for applicant in self: applicant.department_id = applicant.job_id.department_id.id @api.depends('job_id')