[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user