[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:
Toufik Ben Jaa
2019-05-03 08:44:07 +00:00
parent 9d26c122ab
commit 69cd8bc675
+2 -1
View File
@@ -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: