[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
This commit is contained in:
Barad Mahendra
2020-08-21 05:41:12 +00:00
parent 7fee15258d
commit 9c745e0271
+1 -1
View File
@@ -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):