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.candidate

Compute Method: _compute_attachment_count

View 18.0
Inputs Method Outputs
  • id
- read_group_res = self.env['ir.attachment']._read_group(
-             [('res_model', '=', 'hr.candidate'), ('res_id', 'in', self.ids)],
-             ['res_id'], ['__count'])
- attach_data = dict(read_group_res)
- for candidate in self:
-             candidate.attachment_count = attach_data.get(candidate.id, 0)
  • attachment_count

Back to entity