Skip to content

Commit ac8b52c

Browse files
committed
[PERF] hr_recruitment: Add missing indexes
Description ----------- Add indexes on `linkedin_profile` & `pool_applicant_id` to support: - `_get_similar_applicants_domain` - `_compute_application_count` - `_compute_talent_pool_count` - `_compute_is_applicant_in_pool` These are called from many places, especially when browsing applicants. closes odoo#219694 X-original-commit: 20c6889 Signed-off-by: Jurgen Gjini (jugj) <jugj@odoo.com> Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
1 parent e01d6f1 commit ac8b52c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

addons/hr_recruitment/models/hr_applicant.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class HrApplicant(models.Model):
6565
partner_phone_sanitized = fields.Char(
6666
string="Sanitized Phone Number", compute='_compute_partner_phone_sanitized', store=True, index='btree_not_null'
6767
)
68-
linkedin_profile = fields.Char('LinkedIn Profile')
68+
linkedin_profile = fields.Char('LinkedIn Profile', index='btree_not_null')
6969
type_id = fields.Many2one('hr.recruitment.degree', "Degree")
7070
availability = fields.Date("Availability", help="The date at which the applicant will be available to start working", tracking=True)
7171
color = fields.Integer("Color Index", default=0)
@@ -135,7 +135,7 @@ class HrApplicant(models.Model):
135135
applicant_notes = fields.Html()
136136
refuse_date = fields.Datetime('Refuse Date')
137137
talent_pool_ids = fields.Many2many(comodel_name="hr.talent.pool", string="Talent Pools", groups="base.group_user")
138-
pool_applicant_id = fields.Many2one("hr.applicant")
138+
pool_applicant_id = fields.Many2one("hr.applicant", index='btree_not_null')
139139
is_pool_applicant = fields.Boolean(compute="_compute_is_pool")
140140
is_applicant_in_pool = fields.Boolean(
141141
compute="_compute_is_applicant_in_pool", search="_search_is_applicant_in_pool"

0 commit comments

Comments
 (0)