From fb14e4519ffb523c78ae7a973052ec09cad8a7a5 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 28 Aug 2018 17:30:44 +0200 Subject: [PATCH] [FIX] gamification: allow employee to grant badge If the user does not have the rights to write on the user profile, he will trigger an access error. Put it as a simple computed readonly field to avoid access errors In 10.0, a workaround was developed at 0312c604f44 but it should be reverted after this commit --- .../hr_gamification/wizard/gamification_badge_user_wizard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/hr_gamification/wizard/gamification_badge_user_wizard.py b/addons/hr_gamification/wizard/gamification_badge_user_wizard.py index f271da9dc84..6491d058f18 100644 --- a/addons/hr_gamification/wizard/gamification_badge_user_wizard.py +++ b/addons/hr_gamification/wizard/gamification_badge_user_wizard.py @@ -9,7 +9,8 @@ class GamificationBadgeUserWizard(models.TransientModel): _inherit = 'gamification.badge.user.wizard' employee_id = fields.Many2one('hr.employee', string='Employee', required=True) - user_id = fields.Many2one('res.users', string='User', related='employee_id.user_id', store=True) + user_id = fields.Many2one('res.users', string='User', related='employee_id.user_id', + store=False, readonly=True) @api.multi def action_grant_badge(self):