From 5c24f1881f8fdd65dd08a7ec8767df2cd3a40155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Faruk=20Avc=C4=B1?= Date: Fri, 9 Jan 2026 15:53:51 +0100 Subject: [PATCH] [FIX] hr_gamification: solve runbot error about record assignment Bug production steps: It shows an error in the runbot build Bug cause: self.env['gamification.goal'].search returns goal ids in an array [ids], but assigning this array to directly employee.goals_ids is giving error because it is O2M field. Bug solution: Assigning in the proper format ([(6, 0, goals.ids)]) instead of just assigning goals.ids. task - 5473086 --- addons/hr_gamification/models/hr_employee.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/hr_gamification/models/hr_employee.py b/addons/hr_gamification/models/hr_employee.py index 23ec7882f669a..1a8938b43c2a8 100644 --- a/addons/hr_gamification/models/hr_employee.py +++ b/addons/hr_gamification/models/hr_employee.py @@ -21,10 +21,11 @@ class HrEmployee(models.Model): @api.depends('user_id.goal_ids.challenge_id.challenge_category') def _compute_employee_goals(self): for employee in self: - employee.goal_ids = self.env['gamification.goal'].search([ + goals = self.env['gamification.goal'].search([ ('user_id', '=', employee.user_id.id), ('challenge_id.challenge_category', '=', 'hr'), ]) + employee.goal_ids = [(6, 0, goals.ids)] @api.depends('direct_badge_ids', 'user_id.badge_ids.employee_id') def _compute_employee_badges(self):