Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Recruitment

Entity: hr.job

Compute Method: _compute_open_application_count

Inputs Method Outputs
hired_stages = self.env['hr.recruitment.stage'].search([('hired_stage', '=', True)])
result = dict(self.env['hr.applicant']._read_group([
            ('job_id', 'in', self.ids),
            ('stage_id', 'not in', hired_stages.ids),
        ], ['job_id'], ['__count']))
for job in self:
            job.open_application_count = result.get(job, 0)

Back to entity