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_all_application_count

Inputs Method Outputs
  • id
read_group_result = self.env['hr.applicant'].with_context(active_test=False)._read_group([
            ('job_id', 'in', self.ids),
            '|',
                ('active', '=', True),
                '&',
                ('active', '=', False), ('refuse_reason_id', '!=', False),
        ], ['job_id'], ['__count'])
result = {job.id: count for job, count in read_group_result}
for job in self:
            job.all_application_count = result.get(job.id, 0)

Back to entity