[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.
This commit is contained in:
@@ -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':
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
<field name="department_id"/>
|
||||
<field name="no_of_recruitment"/>
|
||||
<field name="color"/>
|
||||
<field name="application_ids"/>
|
||||
<field name="document_ids"/>
|
||||
<field name="no_of_hired_employee"/>
|
||||
<field name="manager_id"/>
|
||||
@@ -46,7 +45,7 @@
|
||||
<t t-if="record.state.raw_value == 'recruit'">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 o_kanban_primary_left">
|
||||
<button class="btn btn-primary" name="%(action_hr_job_applications)d" type="action"><t t-esc="record.application_ids.raw_value.length"/> Application(s)</button>
|
||||
<button class="btn btn-primary" name="%(action_hr_job_applications)d" type="action">Application(s)</button>
|
||||
</div>
|
||||
<div class="col-xs-6 o_kanban_primary_right">
|
||||
<div t-if="record.document_ids.raw_value.length > 0" class="row">
|
||||
|
||||
Reference in New Issue
Block a user