summaryrefslogtreecommitdiff
path: root/addons/survey/tests
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-12-04 13:42:38 +0000
committerThibault Delavallée <tde@odoo.com>2019-01-14 15:22:18 +0000
commit7c50807bece0ded1333c44fb996405d09f7d40e0 (patch)
tree7202153688ec570df5bb8b04fbdbe64bd4bb0b3d /addons/survey/tests
parent66e00f642afccebf2bd67a1aad1bc8bef64439fb (diff)
[REF] survey: improve access mode options and survey form view
In this commit we extend access option on survey model. Access mode is now defined as * public: everyone can access this survey. People having a link to the survey can create answers and fill survey. Those are used for example as satisfaction surveys; * login required: only users can access this survey. Depending on auth signup configuration this either limits survey access or forces people to create an account; * employees only: only users belonging to base.group_user can access this survey. Those are used for example for internal polls; * on invitation only: only people receiving a token can access this survey. They do not need to be an user, having a token is sufficient. Those are used for example for appraisals; Note that survey officers and managers can always create and update answers according to their ACLs. In this commit we also improve a bit survey form view while changing the access field. Surveys users now have access to all buttons and some labels have been updated to better fit current Odoo style. Archive button is now always displayed as it is considered as a standard way of managing surveys. This commit is linked to task ID 1911586 and PR #28986.
Diffstat (limited to 'addons/survey/tests')
-rw-r--r--addons/survey/tests/common.py2
-rw-r--r--addons/survey/tests/test_survey_flow.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/survey/tests/common.py b/addons/survey/tests/common.py
index fbe03f3f24b..4235739ba14 100644
--- a/addons/survey/tests/common.py
+++ b/addons/survey/tests/common.py
@@ -64,7 +64,7 @@ class SurveyCase(common.SavepointCase):
self.survey = self.env['survey.survey'].sudo(self.survey_manager).create({
'title': 'Test Survey',
- 'auth_required': True,
+ 'access_mode': 'authentication',
'users_can_go_back': False,
})
self.page_0 = self.env['survey.page'].sudo(self.survey_manager).create({
diff --git a/addons/survey/tests/test_survey_flow.py b/addons/survey/tests/test_survey_flow.py
index 537ab1d46d4..11d9ed2a57c 100644
--- a/addons/survey/tests/test_survey_flow.py
+++ b/addons/survey/tests/test_survey_flow.py
@@ -47,7 +47,7 @@ class TestSurveyFlow(common.SurveyCase, HttpCase):
with self.sudo(self.survey_manager):
survey = self.env['survey.survey'].create({
'title': 'Public Survey for Tarte Al Djotte',
- 'auth_required': False,
+ 'access_mode': 'public',
})
# First page is about customer data