From 9c745e027172b0bda860fb2dc42a8dd1f280165b Mon Sep 17 00:00:00 2001 From: Barad Mahendra Date: Fri, 21 Aug 2020 05:41:05 +0000 Subject: [PATCH] [FIX] hr_recruitment: Fix traceback on job creation Currently, when creating job postion from config menu then it will generate the traceback of key error. So in this commit, If job id found in result then assign the documents_ids of that job else set the false. TaskID: 2283753 --- addons/hr_recruitment/models/hr_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_recruitment/models/hr_job.py b/addons/hr_recruitment/models/hr_job.py index b01f311750d..2d446612c8e 100644 --- a/addons/hr_recruitment/models/hr_job.py +++ b/addons/hr_recruitment/models/hr_job.py @@ -72,7 +72,7 @@ class Job(models.Model): result[attachment.res_id] |= attachment for job in self: - job.document_ids = result[job.id] + job.document_ids = result.get(job.id, False) job.documents_count = len(job.document_ids) def _compute_all_application_count(self):