From 69cd8bc675833870fa242a630391c5e416717e2b Mon Sep 17 00:00:00 2001 From: Toufik Ben Jaa Date: Fri, 3 May 2019 08:44:07 +0000 Subject: [PATCH] [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) --- addons/survey/models/survey_survey.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/survey/models/survey_survey.py b/addons/survey/models/survey_survey.py index 9b52a86f2ed..b7002cf052c 100644 --- a/addons/survey/models/survey_survey.py +++ b/addons/survey/models/survey_survey.py @@ -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: