[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 0312c604f4 but it should be reverted
after this commit
This commit is contained in:
Martin Trigaux
2018-08-28 17:35:20 +02:00
parent 03108f7237
commit fb14e4519f
@@ -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):