[FIX] survey: allow survey user to test a survey
- When tyring to test a survey as a "Survey User" you are redirected to the homepage. This is due to a faulty access rights check that only allows "Survey Managers" to test them. closes odoo/odoo#33132 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -239,7 +239,8 @@ class Survey(models.Model):
|
||||
""" Ensure conditions to create new tokens are met. """
|
||||
self.ensure_one()
|
||||
if test_entry:
|
||||
if not user.has_group('survey.group_survey_manager') or not user.has_group('survey.group_survey_user'):
|
||||
# the current user must have the access rights to survey
|
||||
if not user.has_group('survey.group_survey_user'):
|
||||
raise UserError(_('Creating test token is not allowed for you.'))
|
||||
else:
|
||||
if not self.active:
|
||||
|
||||
Reference in New Issue
Block a user