Commit Graph
102 Commits
Author SHA1 Message Date
Aurélien Warnon 4e39a89944 [IMP] survey: use default filter instead of different action
When accessing answers (survey.user_input) through the survey form view, we used a separate action
to hide the test entries.

This could be confusing when you actually wanted to see the test entries for that survey.

This commit changes that to use a default filter instead, leading to the same visual behavior.

Task #2058598

closes odoo/odoo#36835

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-09-13 11:29:13 +00:00
Aurélien Warnon 4e712fc2f9 [IMP] survey: mark certification documents of test entries as "specimen"
When a user tests the Survey, he should not get a valid certification document when he succeeds.
To avoid that, we add a "specimen" watermark on the background when the user_input is a test_entry.

In addition, we also don't send the mail containing the certification for test entries.

Task#2058598
2019-09-13 11:28:04 +00:00
Thibault Delavallée e3828ec9cd [FIX] survey: fix another crashing computed field
Still due to some recent ORM changes: finding a real ID, assigning values
even in create mode with default values.

Task 2058598 (survey internal testing)
PR #36756
2019-09-13 10:05:15 +00:00
mcm-odoo 247bc4aaa1 [IMP] survey: little optimization for user_input_line creation/update
Before:
  The method _get_mark called Model.exists() just after calling
  Model.browse
  This process makes 2 calls to database to do almost the same thing

Now:
  Removed the method _get_mark and directly call Model.browse

FP feedback

Task 2066646
2019-09-11 09:16:48 +00:00
Hardik PrajapatiandMohammed Shekha 2581076a09 [IMP] survey: do not set a question type on question being section
This commit header is quite fun. If a question is not a question it should
not have a type. Maybe it should not be a question but, hey, you don't always
do what you want. That's life my dear Lucette.

In this commit we remove required attribute from python field definition of
question_type and make it required conditional based. Real questions have a
type, unreal questions have no type.

Alss update Questions menu entry to display only real questions, not unreal
questions.

Most of this commit message makes no sense, but remember who asked to push
this model.

Task 2053833

closes odoo/odoo#35835

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>


Co-authored-by: Hardik K Prajapati <hap@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-08-30 11:09:21 +00:00
Jitendra Prajapati 240e860f24 [IMP] survey: add an overall correctness graph when finishing a certification
PURPOSE

Perform a back2basics review of survey to improve daily use, new user
onboarding and labelling.

SPECIFICATIONS

When finishing a certification survey, add an overall correctness circular
graph. Quarters are

  * correct
  * partially (if multiple corrects answers on the survey);
  * incorrect
  * unanswered

Questions without points are not displayed in this graph.

LINKS

Task 2039068
PR #36229
2019-08-29 15:37:04 +00:00
Jitendra Prajapati ee5649cdff [IMP] survey: improve user answers model and display in backend
PURPOSE

Perform a back2basics review of survey to improve daily use, new user
onboarding and labelling.

SPECIFICATIONS

Order answer lines following question order.

Display section in answer lines form view to better understand question and
answer organization.

Add a correct flag on answer lines and display it in user input embedded
view in order to know which line are correct.

LINKS

Task 2039068
PR #36229
2019-08-29 15:36:48 +00:00
Thibault Delavallée 0636347099 [IMP] survey: reorder some code to ease understanding
PURPOSE

Perform a back2basics review of survey to improve daily use, new user
onboarding and labelling.

SPECIFICATIONS

Reorder some code to better understand module organization.

LINKS

Task 2039068
PR #36229
2019-08-29 15:36:32 +00:00
Jitendra Prajapati 4fbd4a8c6a [IMP] survey: improve wording and labels
PURPOSE

Perform a back2basics review of survey to improve daily use, new user
onboarding and labelling.

SPECIFICATIONS

Improve labels of fields and wording in actions. See commit content for proper
specifications.

LINKS

Task 2039068
PR #36229
2019-08-29 15:36:13 +00:00
Raphael Collet 5324921861 [FIX] *: do not use '' as many2one value
closes odoo/odoo#35907

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-22 13:40:40 +00:00
laa ed6575a813 [IMP] survey : Kanban card revamp
In order to display some stats on survey's card (in the kanban view), the survey's card has been reorganized:

We remove all the button present in the bottom of the card, button concerned are:
• analyze answers
• test
• share

We recreate the button "share" in the dropdown menu of the card.

We add the next information:
- For each survey with scoring, the number of people who passed the test is displayed as well as the success rate.
- For each survey with scoring and certification, a certification icon is displayed and the string "passed"  (corresponding to the number of people who passed the test) bec$

TASK-ID : 2045617

closes odoo/odoo#35479

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-23 06:56:36 +00:00
Christophe Simonis 886eca0131 [IMP] *: remove usage of oldname attribute
This attribute is misleading as it is insufficient to correctly upgrade
the database. It only renames the column in the database, but other
operations are needed, like updating the corresponding `ir.model.fields`
record (and its xmlid). The default values and the translations are also
lost during the upgrade.

Moreover, this feature was misused. It was:
 - left on fields during multiple versions.
 - used on reports (SQL views). This would be ok if the feature was
   complete, but, as is, it was useless.
 - kept unchanged after a second renaming of the field (which can happen
   versions later the first rename).
 - used, even when the meaning of the field changed. i.e. the field
   `archived` has been renamed to the classic `active`, but the value
   in the database should be switched.
2019-08-05 09:36:41 +00:00
Jérémy HennecartandThibault Delavallée ee29641b08 [REF] website_slide_survey: improve integration into eLeaning application
PURPOSE

eLearning should have its own application in manager. Indeed this is becoming
a big application and having it embedded inside Website application is not
enough anymore. It should also hold updated and easy-to-use menus,
navigation, actions and views in backend.

SPECIFICATIONS

Add menu entry inside Courses
  * Certifications: kanban view of surveys of type certificate

Add menu entry inside Reporting
  * Certifications: list view on surveys of type certificate
    Columns: Title, Survey Stage, Registered People, Certified People, Attempts
    Success Rate (certified/attempts), Average Results

LINKS

Task 1978729
PR #35061

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Jérémy Hennecart <jeh@odoo.com>
2019-08-05 08:43:21 +00:00
Patrick Hoste 81c7afb833 [IMP] eLearning: adds course and certification stat button on partner
Adds two stats button on res.partner form view :
- The first one will show all the courses that the partner is following.
- The second one will show all the certifications the partner has passed.
When the partner is a company :
- All the courses followed by all the partners are shown without duplicate.
- All the certifications passed by all the partners are shown.

PR : #34908
Task ID : 2034097

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-31 09:54:04 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
David Beguin ff9c37b08b [IMP] survey : give bagde on survey passed (no cron waiting)
To avoid having to wait the cron that distribute badges to elligible users,
we run the cron manually at the survey passed
if the survey is a certification and if the certification delivers a badge.

Task ID : 1935136
PR #31486
2019-07-15 08:16:43 +00:00
David Beguin be9461bf8b [IMP] gamification, survey : apply badge on certification survey
This commit allow gaining a badge at the end of a certification survey if succeeded.
The badge can be configured on the survey if the certification mode is activated.

The badge is linked directly to the survey and not the challenge,
because it makes more sense to configure directly the reward on the survey and
not the way to gain this reward. As the way is always the same.
Only one badge can be set on the certification survey.
Only the name, description, image and badge level can be configured.
The rest of badge configuration is automatically set to correspond to the use case.
When a badge is configured on a certification survey, the needed challange, goal
and challenge line are autogenerated.

The badge is available on the user's profile page if he gained it.

Once the badge is configured on the survey, he cannot be changed
(remove + create new one), only modified (badge attributes edition).
The only way to remove the badge is to uncheck 'certification_give_badge'.

When removing the badge from the certification survey, all the autogenerated
records (at badge creation) are deleted to avoid ghost records (as they have
no purpose outside of this context). If the badge is owned by someone, the badge
is only archived. If nobody owns the badge, the badge is deleted.

Survey users now have the right to create badges but not challenges or goals.
All the autogenerated records are handled in sudo, to allow the survey user
to configure a badge on their survey.

Note : To avoid having to rewrite the complete context in an xpath expression
only to display the certification badge on the user's profile page,
the default website_published value of the certification badge is defined
directly in the survey module even if survey does not depend of website.
This attribute will be ignored until website module is installed.

Task ID : 1935136
Closes PR #31486
2019-07-15 08:16:43 +00:00
Adrian Torres 9e71d57d11 [REM] *: remove calls to api.one and adapt code
Adapt all code that was using `api.one` to recordset-style method and
remove any and all calls to `api.one` in preparation for its removal.
2019-07-05 09:04:45 +00:00
Aurélien Warnon 0b1b8f13e1 [IMP] survey: add attempt number on answer views
Purpose
=======

This commit adds the attempt number on the answer (= survey.user_input)
form & tree views.

The attempt number is always relative to its "pool" of attempts and
depends on the "invite_token" if specified.

ex: Attempt n° 2 / 4 (where "4" is the attempts_limit of the related survey).

closes odoo/odoo#31771

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-24 11:56:13 +00:00
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
Aurélien Warnon d6f07e659d [REF] survey: add a "_mark_done" method to improve answers state management
As other modules than survey (namely hr_skills) now need a hook to add specific
behavior when a survey answer is marked as 'done', we removed the '_send_certification'
method and replaced it with a '_mark_done' method.

It will make it easier to override this method as it has a more generic meaning.

closes odoo/odoo#32880

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-23 12:05:29 +00:00
Christophe Simonis 8dd5a85267 [MERGE] forward port branch saas-12.3 up to 60e71302a3 2019-05-13 15:26:12 +02:00
Toufik Ben Jaa 69cd8bc675 [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>
2019-05-03 08:44:07 +00:00
Aurélien Warnon 2268e747c9 [FIX] survey: allow creating survey with no sections
Task#1958723

This commit fixes the survey form to allow creating, testing and sharing
surveys that don't have sections as long as they don't use the "page_per_section"
layout.

closes odoo/odoo#32159

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-10 15:03:10 +00:00
Lucas Lefèvre 6207391276 [FIX] survey: Display datetime answers in results
Currently, user input lines of type ´datetime´ are not
correctly displayed in both situations:

1. not displayed at all in the survey result frontend page

2. the answered value is not displayed in the form view of
a user input line.

This commit fixes both issues

closes odoo/odoo#31815

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-03-13 12:47:33 +00:00
Aurélien Warnon db53057528 [IMP] survey: add a stat button on survey to show the certified count
Purpose
=======

This commit adds a stat button on the survey form view showing the amount
of answers with the quizz_passed field set to True.
It allows to quickly see people that have been granted the certification.

On click, the stat button redirects to the answers list view with the "Quizz passed"
filter defaulted to True.
2019-03-08 11:00:06 +00:00
Aurélien Warnon 1932e25f68 [IMP] survey: show the quizz_passed field in the answers views
Purpose
=======

The quizz_passed field is now more important because it determines whether
a certification has been successfully taken or not.

This commit adds the quizz_passed field in:
- The search view of user_input
- The list view of user_input
- The form view of user_input (along with the score)
2019-03-08 11:00:06 +00:00
Aurélien Warnon 92141334f8 [FIX] survey: fix survey statistics computation
Purpose
=======

This commit fixes the shared dict in the survey statistics computation that
causes surveys to incorrectly share the same stats when computed in batch.
2019-02-27 15:20:29 +00:00
Aurélien Warnon eb45f84128 [FIX] survey: fix invitation sending with no page_ids
Puprose
=======

This commit fixes the survey to allow sending invitation even if the survey
has no pages as long as the questions_layout is 'page_per_question'.
2019-02-27 15:20:28 +00:00
Aurélien Warnon f322816ae8 [ADD] website_slides_survey: add a new bridge between slide and survey
Task #1940360
Subtask of #1902304

Purpose
=======

Adds certification capabilities to the website_slides module.
Channel/courses can now include certifications as a new type of slide.

This new type of slide is available as a "Certification" button on the slide creation
frontend view (next to "Video", "Presentation", ...).
Users have to link the slide to an actual survey that has the 'certificate' field
set to true (that will populate the slide's survey_id field).

Slides of type certification are handled in frontend in a very simple way for now:
- A button "Begin certification" that redirects the user to the related survey frontend.
- A button "Download certification" when the user has succeeded the certification.
- When the survey is done, if it's linked to a slide, a button "Go back to course" allows
  the user to go back to the slide frontend.

(There is a special use case for when the website_publisher designing the survey lands on a
certification slide: he is allowed to test the survey with a survey_input created as test_entry)

Survey creation as well as limited time, limited number of attempts, ... are still completely
handled in the survey module. That means that the user will have to first create a suitable survey
that is a certification and only then create a slide of type "certification" and link
the created survey to it.

Ideally, the taking of the survey should be transparently included in the slide frontend but
it requires a full refactoring of the way surveys are submitted. This will most likely come in
a later commit.

This commit is an advanced merge of full eLearning module (see task #1902304).
2019-02-15 15:32:46 +00:00
Aurélien Warnon 120ff4a1db [FIX] survey: make survey access_token copy=False for duplicate
Task #1902306

Purpose
=======

The "access_token" needs to be unique so it should not be copied when
duplicating the survey.
2019-02-06 13:20:52 +00:00
Aurélien Warnon 99bb017f68 [IMP] survey: add invite_token to user_input to reset the attempts count
Task #1902306

Purpose
=======

When you invite people to take a certification multiple times, the user will have his "attempts" count reset
with every invitation.
This is important when there is a limited number of attempts available.
ex: A user invited twice will have 2 x allowed_attempts_count to succeed the survey.

Attempts are now separated in different pools using a "invite_token" field on the survey.user_input.
2019-02-06 13:20:52 +00:00
Aurélien Warnon 445541989f [IMP] survey: add randomization and survey layout selection
Task #1902306

Purpose
=======

The "page" concept is now only present in the user interface.
Surveys are split in "sections" that have two purposes:
- Organizing a (long) survey/certification
- Allow to pick a random questions count for that section (more information here after)

On the user interface, based on the questions_layout field, surveys are displayed:
- On a single page, where sections still appear but are only used as visual separations
- On multiple pages, having one page per section (this matches the previous behavior)
- On multiple pages, having one page per *question*

On top of that page concept, this commit added randomization for the survey questions.
The randomization mechanism will take X questions per section of the survey.
The survey.user_input is initialized with the selected questions to be sure to keep that
set of questions and avoid showing a new set of questions every time the user refreshes the page.
This also allows to easilly go back and know which question we have to show.
2019-02-06 10:34:43 +00:00
Aurélien Warnon afb1abbb60 [IMP] survey: scoring & certification
Task #1902306

Purpose
=======

This commit adds certification capabilities to the survey module.

A certification is a survey with the "certification" flag set to true than can be linked
to a certification email template that contains a certification document (PDF).
This template can be edited by the user in the technical settings to customize the certification email/document.

To be able to implement this certification concept, we also have to add scoring mechanisms to surveys.
survey.questions of type 'simple_choice' and 'multiple_choice' now have scores for the suggested answers.
These question scores allow to compute a global score that is used to determine whether the user has successfully
passed the certification or not.

As additional features, we also have:
- A time limit with an interface timer that limits the test to X minutes
  When reached, the survey is automatically submitted and unregistered (= unsubmitted) answers are not taken into account.
- A limited number of attempts for the survey/certification
  If reached, the user can't take the survey/certification anymore

The 'survey result' layout was adapted accordingly to show the success rate of participants and the correct answers
to the survey questions.

Specs
=======
- Create a new survey :
  - Add a description field for the survey

- Options on a survey :
  - Passing score : (sum of all good answers) in %
  - If No scoring => No passing score, no certificate
  - If Scoring with answers => Passing score and can see the answers (can create certificate)
  - If Scoring without answers => Passing score but can't review the answers at the end (can create certificate)
  - for the questions, if "no scoring" selected, can 't see the option "good answer" and "score" on the questions
  - If the 2 others options, can see the options "good answer" and "score" on the questions
  - all the types of questions are available for each option.

- Questions
  - Add the option correct answer on the multiples questions (one or more good answers)

- Certifications
  - If scoring, force "mandatory" for "mutliple choices (1or multiple answers)"
  - On the dashboard => visual information that this specific survey is a certification
  - Time Limit : The student is informed on the home screen of the survey of the time limit.
    The clock start when he clicks on "start survey"
  - Template of the certificate : send email with attachment PDF

- Front-end :
  - Add some margin
  - Replace "Back to survey" with the blue-bar from the portal
  - Add a timer (start when the survey starts)
  - Add a progress bar (number of section and number of question inside the section)

- Analyse of the results :
  - First a global graph with the number of people who''ve participated and passed the test

- Stages of a survey :
  - Remove the stage "Permanent"
  - 3 stages :
    - draft : not on-line but can be tested (with phantom token)
    - In progress : on-line
    - closed : not on-line
  - Who can test a survey : the manager and the user. Add this condition to the phantom token.
2019-02-06 10:34:40 +00:00
Aurélien Warnon dba4783326 [REF] survey: convert survey.page to survey.question -> is_page=True
Task #1902306

Purpose
=======

survey.question is now also the model used for the survey's pages (with the "is_page" field set to True).
This allows to put all the pages and questions together in a o2m field on the view side and
easily reorganize your survey by dragging the items around.

It also removes one level of encoding by directly having 'Add a page' and 'Add a question'
links on the tree view of questions, enabling a faster encoding.

However, this has the downside of making the code reading a little bit more complicated.
Efforts were made at the model level to create computed fields so that the use of these models
still seems somewhat logical. That means:
- A survey still has "page_ids" (question_and_page_ids filtered on is_page = True)
- These "page_ids" still have question_ids (questions located between this page and the next)
- These "question_ids" still have a "page_id"

That makes the use and display of these information at view and controller levels easier to understand.
2019-02-06 09:37:59 +00:00
Thibault Delavallée 0e91762c99 [IMP] survey: rename and improve statistics fields
Purpose is to clean a bit those fields. A field holding the number of send
invitations is added as well as a button. It allows to directly jump on
answer linked to an invite which helps dealing with private surveys.

This commit is linked to task ID 1935176 and PR #30689 .
2019-01-31 11:53:44 +00:00
Thibault Delavallée 35df807db8 [FIX] survey: correctly flag answers done with invite
A field exists to differentiate answers done manually through frontend of
survey and answers created through invitation. The field was not correctly
set by the invite wizard. This commit fixes it.

This commit is linked to task ID 1935176 and PR #30689.
2019-01-31 11:53:38 +00:00
Thibault Delavallée e65bcb24fd [IMP] survey: refine access mode option on survey
Purpose of this merge is to improve access mode and authentication management
introduced at 9771fdfe8f . Purpose of this cleaning is to simplify options and make
them clearer. Instead of a selection with 4 entries we propose to use two
fields on survey model :

 * access_mode: everyone with a public link can access and answer; or only
   invited people;
 * login required: whether people have to login to answer or not;

All main use cases are covered with combination of those two options.

This commit is linked to task ID 1932508 and PR #30508.
2019-01-25 13:12:22 +00:00
Thibault Delavallée c801eecf23 [IMP] survey: access survey through access tokens
Purpose of this commit is to use an access token to access survey instead
of their ID. Routes are updated to use that token instead of the survey ID.
Purpose is to have less discoverable routes and be able to control a bit more
survey access even if it is not really a security parameter.

Some renaming is performed to avoid confusion in terms. Survey token and
answer token are now clearly labeled differently in the code to know which
model we are working on.

Some templates are updated to directly use the answer as base record to
have access to token and test_entry fields instead of giving those parameter
values directly in the controller. It makes some more diff but also allow
easier edition and improvement in templates when having directly survey
and answer record available.

This commit is linked to task ID 1932508 and PR #30508.
2019-01-25 13:11:50 +00:00
David Beguin d2ed4ba93d [IMP] survey : add datetime question type
to be able to choose between asking for a date or a date with time,
a datetime question type is now added.

Task ID : 1911291
Closes PR #29054
2019-01-23 13:28:30 +00:00
David Beguin f2e2b6260b [IMP] survey : scroll up to first survey validation error
- Change the default value of the Validation Error message on
    the Date : "The answer you entered is not valid."
- If long page, click on next and one error, the page should go up
    to allow the visitor to see where the error is.

Task ID : 1911291
Closes PR #29054
2019-01-23 13:02:56 +00:00
Thibault Delavallée 9b12854a4f [FIX] survey: correctly check user being public when creating a new answer 2019-01-18 09:52:36 +00:00
Thibault Delavallée b7e13cf04b [FIX] survey: fix typo
closes odoo/odoo#30257
2019-01-16 09:24:10 +00:00
Thibault Delavallée e6c0a326d6 [IMP] survey: do not count test user entries as real inputs
Purpose of this commit is to remove test entries from statistics and reports
in survey. Indeed they are not real results and should not be taken into
account. We also display a warning on portal page of surveys when user is
in test mode.

This commit is linked to task ID 1865453 and PR #29316.
2019-01-15 15:54:54 +00:00
Thibault Delavallée f15861c36d [IMP] survey: add a category on surveys to allow filtering them
Purpose of this commit is to add a category selection field on surveys. It
will allow to filter / select surveys according to their category and their
main use.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 7d110c20c5 [REF] survey: refactor template use on invite wizard
Purpose of this merge is to remove the ugly __URL__ hack of survey templates.
It is solved by making template rendered on user_input model. This means each
invitation recipient will received its own rendered mail. Small jinja code
allows therefore to include the url in a clean odoo-style way.

Subject and body in survey invite wizard are not rendered anymore. It means
jinja could be displayed. This is necessary as this wizard will work in batch
mode, rendering the body on each recipient.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 6fa4688693 [REF] survey: refactor invitation wizard
Purpose is to clean and simplify invite wizard on surveys. Main purpose is
to simplify options.

Public link is displayed for public surveys, allowing to quickly share
it. When sending emails a token is now generated for each recipient. There is
no "batch public link" sending option anymore as it is not really necessary.

Check is done on recipients and emails to match the access mode option. Having
a restricted survey gives the same limitations on people to invite (users,
employees, ...).

Code is cleaned to ease its understanding and prepare future evolution notably
with appraisals.

An existing mode field is added on invite model. All options are currently
not used but it prepares future addition to survey, notably for certifications.
Its purpose is to know what to do with existing tokens when inviting new
recipients. It is used notably to resend tokens through the user_input form
view instead of relying on a custom context key.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 7c50807bec [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.
2019-01-14 15:22:18 +00:00
Thibault Delavallée dfc37ecede [REF] survey: adapt controllers and portal flow to new ACLs
Purpose of this commit is to adapt controllers and routes to new ACLs. As
survey access is now controlled routes have to use survey ID and browse
records as sudo when access is granted.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00
Thibault Delavallée 5878579b10 [FIX] survey: is_closed field on survey should be readonly
Otherwise having this value coming from a view triggers a write on the
survey stage model. This write is unnecessary ad is_closed should really
be readonly. It may also causes access rights issues notably for survey
users that cannot update stages.

This commit is linked to task ID 1911586 and PR #28986.
2019-01-14 15:22:18 +00:00