From 2adba30ef2ae9ddd9c9318e0bec7797ba90b37ee Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Thu, 24 Feb 2022 15:10:35 +0000 Subject: [PATCH] [IMP] hr_gamification: Improve _compute_employee_badges perf From 20ms to 0.3ms closes odoo/odoo#85133 Related: odoo/enterprise#24628 Related: odoo/upgrade#3294 Signed-off-by: Yannick Tivisse (yti) --- addons/hr_gamification/models/gamification.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_gamification/models/gamification.py b/addons/hr_gamification/models/gamification.py index 6f9dba1777f..4fc2831f169 100644 --- a/addons/hr_gamification/models/gamification.py +++ b/addons/hr_gamification/models/gamification.py @@ -9,7 +9,7 @@ class GamificationBadgeUser(models.Model): """User having received a badge""" _inherit = 'gamification.badge.user' - employee_id = fields.Many2one('hr.employee', string='Employee') + employee_id = fields.Many2one('hr.employee', string='Employee', index=True) @api.constrains('employee_id') def _check_employee_related_user(self):