From 314dab85df839bc1ceaaaafc844863cff2396635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 29 Sep 2015 14:42:27 +0200 Subject: [PATCH] [FIX] hr_applicant: small fixes X Application(s) becomes just Application(s) on the kanban card in order to be coherent with other kanban views When computing a job documents, do not include documents from already hired employees, only applicants in the pipe. --- addons/hr_recruitment/models/hr_job.py | 4 ++-- addons/hr_recruitment/views/hr_job_views.xml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/hr_recruitment/models/hr_job.py b/addons/hr_recruitment/models/hr_job.py index 4a8ca9445e9..2cdf9d06572 100644 --- a/addons/hr_recruitment/models/hr_job.py +++ b/addons/hr_recruitment/models/hr_job.py @@ -36,12 +36,12 @@ class Job(models.Model): color = fields.Integer("Color Index") def _compute_document_ids(self): - applicants = self.mapped('application_ids') + applicants = self.mapped('application_ids').filtered(lambda self: not self.emp_id) app_to_job = dict((applicant.id, applicant.job_id.id) for applicant in applicants) attachments = self.env['ir.attachment'].search([ '|', '&', ('res_model', '=', 'hr.job'), ('res_id', 'in', self.ids), - '&', ('res_model', '=', 'hr.applicant'), ('res_id', 'in', self.mapped('application_ids').ids)]) + '&', ('res_model', '=', 'hr.applicant'), ('res_id', 'in', applicants.ids)]) result = dict.fromkeys(self.ids, self.env['ir.attachment']) for attachment in attachments: if attachment.res_model == 'hr.applicant': diff --git a/addons/hr_recruitment/views/hr_job_views.xml b/addons/hr_recruitment/views/hr_job_views.xml index 4a49a83cd11..726875c08c6 100644 --- a/addons/hr_recruitment/views/hr_job_views.xml +++ b/addons/hr_recruitment/views/hr_job_views.xml @@ -19,7 +19,6 @@ - @@ -46,7 +45,7 @@
- +