Commit Graph
277 Commits
Author SHA1 Message Date
Yannick Tivisse effb0ffc8e [IMP] survey: Migrate tree/kanban views to owl
closes odoo/odoo#98865

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-30 19:18:47 +02:00
Mathieu Duckerts-Antoine 86e85ad5fd [REF] survey: convert survey_description_page
This commit converts the field "survey_description_page" field to the
new WOWL field API.

Part-of: odoo/odoo#97984
2022-08-29 13:49:10 +02:00
Lucas Perais eac5022455 [REF] survey: convert question_page_one2many
This commit converts the old one2many field to display survey questions
and sections to the new WOWL field API.

Part-of: odoo/odoo#97984
2022-08-29 13:49:10 +02:00
Matthieu Stockbauer fe699a241d [IMP] *: adapt client code to use websocket instead of longpolling
*: bus, calendar, hr_attendance, iap_mail, im_livechat, project, snailmail,
snailmail_account, survey, web, web_editor, website_livechat.

This commit is part of the websocket integration in Odoo.
This bus service now communicates with a shared worker in order to provide
a single websocket connection for multiple tabs. It is designed to
be used as a websocket except that events are slightly different,
re-connection is handled automatically. If the browser does not support shared
worker (Safari), the service fallback on a simple web worker.

Available events are:
   - connect : fired upon a successful connection.
   - disconnect : fired upon reception of the websocket close event.
     The close code and reason are given to the listeners callback.
   - reconnect : fired upon a successful re-connection.
   - reconnecting : triggered when the worker starts to try reconnecting.
   - notification : fired upon the reception of notifications.

Since multiple tabs are now handled by a worker, the cross_tab bus is no longer
required and has been removed.

Part-of: odoo/odoo#75510
2022-08-23 17:55:10 +02:00
Guillaume (gdi) d36c14e346 [FIX] website, survey: correct the aria-labelledby
The attribute aria-labelledby was used erroneously and was misspelled.
This commit corrects that by replacing it with the aria-label attribute.

task-2937538

closes odoo/odoo#98401

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-23 15:05:33 +02:00
Adrien Schoffeniels 34c98e999d [IMP] survey: implement a tour
PURPOSE:

This commit adds a tour that is started when the survey module is
installed, and makes small changes to be able to implement the tour.

SPECS

-Implementation of the tour:
The tour suggests to the user to try and test a sample survey, and shows how
to check the results gathered for this survey.

-Changed the target of the "test" button to "self":
Since the test action is used during the tour, the test page needs to be opened
in the same tab so that the tour can continue.

Task-2794884

Part-of: odoo/odoo#87326
2022-08-17 19:47:59 +02:00
Adrien Schoffeniels d981d7efc1 [IMP] survey: improve survey samples accessibility
PURPOSE:

This commit improves the accessibility of the survey samples when no records
are shown.

SPECS

Remove the modal used to show the samples and show them on the empty screen
instead.

When no survey exists, the user gets the proposition of trying survey samples.
Previously, the user had to click on a button to open a modal showing the
different samples. Now, the samples are shown in the empty screen directly.

If the user does not have the rights to create surveys, the "Try It" buttons
are removed from the NoContentHelper.

Task-2794884

Part-of: odoo/odoo#87326
2022-08-17 19:47:58 +02:00
Noe Antoine 137eddcdb4 [IMP] survey: improve image readability and add zoom widget
Before this commit, images displayed on survey question answers
were small and hard to read, and nothing existed in order to zoom
on them properly.

AFTER THIS COMMIT

Backend:

A new field value_image_filename is added to store the names of
the image fields. They are seen when editing an answer (line).

The max_height and max_width of the images are raised to 1024 px
on their field definition in survey.question.answer to compromise
between image resolution and space, and in order to be able to
zoom on them and still see details

Survey:

A hovering frame is visible on the images, as well as a zoom in
cursor, to indicate we can click on them to zoom in. The rest of
the answer frame is the selection area. Clicking anywhere on the
modal closes it. Until then, a pointer cursor hints the feature.

A new widget SurveyImageZoomer is added. Once the user has clicked
on a choice image, a transparent modal is opened on the whole screen.
This is thought for all size devices : it can be closed by clicking
anywhere, or the cross button, or ESC key. It will always be destroyed.
Also, for small width screens, we do not take the whole height but leave
bands over and below to indicate the mobile users can leave by clicking out.

The image will be displayed in the foreground, zooming on small images
by default, by setting a min width depending on the screen width. We
also avoid using a zoom too large to avoid very low resolution.

The widget allows zooming as long as the image stays in the frame.
The user can zoom both with the mouse scrolling and + and - buttons,
sized to allow medium screen (tablets) to press them accurately.

All keys are disabled but the 'ESC' one when the Zoomer is open to
avoid (undesired) survey navigation.

Task-2566584

closes odoo/odoo#73718

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-08-03 13:44:46 +02:00
tsm-odoo 71d5af4ce0 [FIX] bus, *: fix onNotification/offNotification
*: im_livechat, snailmail_account, survey, web_editor.

The callback registered by the bus service method onNotification was
not the same unregistered by offNotification. Since those method were
superfluous, they have been removed in favor of (add/remove)EventListener.

closes odoo/odoo#96684

Related: odoo/enterprise#29819
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-27 16:34:10 +02:00
tsm-odoo 901a43f532 [IMP] bus, *: improve multi tab service
*: calendar, im_livechat, survey.

Following @ged-odoo review, the multi tab service has been improved:
    - multi_tab_service.js has been moved to the correct location.
    - _callLocalStorage method has been removed and replaced by
      getItemFromLocalStorage/setItemToLocalStorage.
    - underscore.js calls have been removed.
    - multi_tab_service is now using function closure style  instead of class.
    - multi_tab service is now using its own bus instance.
    - service name is now in snake case as per convention.
    - tests have been added.
    - multi tab service now handles setting/removing/getting values
      shared between  all the tabs.

closes odoo/odoo#96386

Enterprise: https://github.com/odoo/enterprise/pull/29694
Related: odoo/enterprise#29694
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-27 03:34:51 +02:00
tsm-odoo e2aeb5fc23 [IMP] bus, *: introduce multi tab service
*: calendar, survey.

In order to ease the PR introducing websockets in Odoo, introduce
the multi service. Indeed, the cross tab bus won't be necessary
anymore but there will still be a need to elect a main tab: some actions
should only be triggered once. To achieve this, the code electing the main
tab has been split with the one handling the longpolling. The crosstab
bus now relies on the multi tab service to known whether or not the
current tab is the main tab.

task-2053917

closes odoo/odoo#96174

Related: odoo/enterprise#29573
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-18 19:55:13 +02:00
tsm-odoo 3b9a90e14f [IMP] bus: replace on/off by (add/remove)EventListener
on/off are deprecated in favor of  addEventListener/removeEventListener.
Calls to the bus service have been updated to reflect those changes.

task-2053917

closes odoo/odoo#96017

Related: odoo/enterprise#29501
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-18 18:41:33 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 9b5c9484fe [REF] *: BS5: adapt changes in media query mixin
> Media query mixins parameters have changed for a more logical approach

> media-breakpoint-down() uses the breakpoint itself instead of the next
> breakpoint (e.g., media-breakpoint-down(lg) instead of
> media-breakpoint-down(md) targets viewports smaller than lg).
> Similarly, the second parameter in media-breakpoint-between() also
> uses the breakpoint itself instead of the next breakpoint (e.g.,
> media-between(sm, lg) instead of media-breakpoint-between(sm, md)
> targets viewports between sm and lg).

https://getbootstrap.com/docs/5.1/migration/#sass

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 9ea1351334 [REF] *: BS5: Migrate forms and inputs
- BS5 uses native inputs instead of pseudo-element for some
  input like checkbox, radio, ...
  in BS5 input checkbox don't have "virtual visual" checkbox anymore
  (::before), so we remove the relative's rules

- removed `.custom-control` class

- `form-switch` use a new layout system in BS5 we adapt the code to
  match the Bootstrap approach (inline SVG).

- In tests, we don't check the exact value of the background as it
  change in community/enterprise, and it's difficult to check the value
  of an SVG.

- Overflow in progressbar is now hidden.
  -> we had to restore it.

- In BS5 margins in forms/inputs has been changed
  -> we had to restore it (e.g. 'mb-3')

- .form-group, .form-row, .form-inline
> Dropped form-specific layout classes for our grid system.
> Use our grid and utilities instead of .form-group, .form-row,
> or .form-inline.

- .input-group-append and .input-group-prepend
> Dropped .input-group-append and .input-group-prepend.
> You can now just add buttons and .input-group-text as direct
> children of the input groups.

Ref:
[1] https://getbootstrap.com/docs/5.1/migration/#forms

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:18 +02:00
Romeo FragomeliandStefano Rigano 41eebf822b [REF] *: BS5: handle contrast color
The logic not identical in BS4 -> BS5
The color contrast system in BS5 relies on WCAG 2.0 contrast algo.
So color-yiq is converted to color-contrast.
Note that there are some "texts/buttons/other visuals" elements
which will not have the same contrast as before.

$yiq-text-dark and $yiq-text-light are respectively replaced with
$color-contrast-dark and $color-contrast-light.

Note that we had to use '$min-contrast-ratio: 2.2' for .o_tag_color_X badge.

Task ID: 2766483

Part-of: odoo/odoo#95450
Co-authored-by: Stefano Rigano <sri@odoo.com>
2022-07-07 13:30:17 +02:00
Romeo Fragomeli 3c4ffd1c89 [REF] *: BS5: remove hover mixins usage (due to BS5 removal)
* = mail, survey, web, web_editor, website, website_event, website_mail

removed mixins:
* hover
* plain-hover-focus
* hover-focus

These mixins are now replaced by their CSS equivalent.

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:16 +02:00
umgu-odoo 24bc6f9777 [rev] survey: revert the fix for live session traceback
This commit reverts the fix done for stable that prevented the traceback
for the live survey on page type of questions had `question_type` set,
in order to fix it in a more robust way in the master.

Reverted commit: https://github.com/odoo/odoo/commit/651af6292c6797c5bd4ed918040508ad8f377ad3

taskID-2841582

Part-of: odoo/odoo#93414
2022-07-06 17:09:58 +02:00
Umesh Gupta 651af6292c [FIX] survey: fix survey live session traceback
Currently, in demo data (or data) of some surveys, there are records of
'survey.question' having 'is_page' field value as true and 'question_type'
is not defined. When question type is not defined, default value
'simple_choice' is assigned to the 'question_type' field. Now when we
create a live session of that survey and goes to the page, it tries to read
the data for bar chart but data is not available (undefined) and throws the
traceback. This happens  because question types 'simple_choice' and
'multiple_choice') are expected to load a bar chart.

It used to work before commit[1] where default 'question_type' value was
being set to 'text_box' (so attempt to load bar chart was not made).

As a safest fix in stable, this commit adds condition in JS and in template
to make sure that bar chart will be instantiated only if the data needed by
(checked with JS) and when the question is not a 'page' (checked with
template).

commit[1] - https://github.com/odoo/odoo/commit/1fb99d7#diff-cf2aadbf6a252dfca6d3450a0ce6ad280b1924afe9a8fc22f7077c998d080009R52

taskID-2841582

closes odoo/odoo#95055

X-original-commit: d7c485e0b0791b6d3d127fedf867b9664df05463
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-01 17:48:05 +02:00
dht-odoo 020046a343 [IMP] survey: improve overall usability of survey
This commit imporves the usability of scoring fields and single-multi
choice question in survey. It does the following changes:

Backend:
- if it's a scored question, respective correct answer must be provided
  otherwise it will now give a warning while trying to save
- points are hidden unless it's a scored question (and will be inline now,
  next to 'Scored' checkbox)
- compute answer_is_correct based on question type of numerical, date,
  datetime for both scored and non-scored questions.

Frontend:
- if the answer is wrong, display the answer inside a red container and below
  the wrong answer, also display the correct one in green font
- if the answer is right, display the answer in a green container
- if the answer is skipped, display the text 'Skipped' inside red container
  with lower opacity
- hide the div for question description if it's empty, to avoid unwanted
  space bewteen questions
- added two different icons 'fa-check-circle' and 'fa-times-circle' for correct
  and incorrect answers respectively for single-multi choice question
- show answer is correct and incorrect based on is_correct not on scored values
- show skipped string  for  single choice, multi choice and matrix questions in
  result page if question was skipped

closes odoo/odoo#63915

Taskid: 2276724
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-24 13:49:04 +02:00
Arthur Detroux (ard) e5b094b683 [IMP] website, *: remove unused assets
*: website_blog, website_event, website_forum, website_links,
   website_livechat, website_slides, survey, web_editor

This commit removes the website navbar root widget, as the edition is
now handled in the backend through the client action and custom menus.

It removes associated widgets and their css.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Quentin Smetz 14ff4c00b4 [IMP] website, *: display a mini-nav to redirect to the backend
*: survey

Add a small overlay allowing common actions, which all redirect to the
Odoo backend.

See merge commit for more information.

task-2687506
2022-06-24 10:28:04 +02:00
Adrien Schoffeniels 89330e8902 [IMP] survey: change live session's go to link layout
PURPOSE:
Clicking the live session's "go to" url in the presentation mode now copies
the url instead of redirecting the presenter, to prevent him of joining the
session in user mode as it messes up.

Task-2816685

Part-of: odoo/odoo#88434
2022-06-08 15:45:44 +02:00
Adrien Schoffeniels 92704847ed [IMP] survey: handle not launched live sessions in quick access view
PURPOSE:
This commit allows to handle the situation in which the quick access
link is used but the live session is not launched yet, by showing an
appropriate error message and by allowing a user with sufficient rights
to launch the live session directly from the quick access page.

Since a session can be launched multiple times, the error related to
closed sessions has been removed, so that the user with the rights to do
it can also "relaunch" a session if it has been closed before.

Task-2816685

Part-of: odoo/odoo#88434
2022-06-08 15:45:44 +02:00
Adrien Schoffeniels 72c4ffc3ee [IMP] survey: improve mobile UI
PURPOSE
This commit removes a few unessential content, fixes
misalignments and removes the input autofocus on mobile devices

SPECS

Remove a few unessential content
Some contents take a considerable space on mobile without adding
essential information, requiring the user to scroll to see useful info.
These contents are now removed on mobile devices.

Fix misalignments
Some parts were misaligned on small screens, taking unnecessary space or
cutting parts of sentences. These parts have been adapted to handle
small screens.

Remove action buttons related to live sessions on small screens
Since the presentation mode doesn't look good on mobile devices
(questions have a lot of linebreaks, arrows do not always work),
and since normally no one presents a live session using a mobile
device, the action buttons "Create Live Session", "Open Session Manager"
and "Close Live Session" are now hidden on small screens.

Remove the autofocus on the first input in survey forms on mobile devices
When a new page of a survey is loaded, the first input is autofocused so
that the user can directly complete the survey without manually getting
the focus. This causes inconsistencies and undesired behaviors on mobile
devices. Especially, when the focus is set automatically on Android devices,
the soft keyboard is opened, the viewport is reduced and the view is scrolled
to the input, which involves that the user misses information about the
survey (such as the beginning of the question for long questions), or
section descriptions. The autofocus has therefore been removed for mobile
devices.

Task-2622693

Part-of: odoo/odoo#87990
2022-06-08 11:20:13 +02:00
Fabio Barbero fc79bd1e0e [IMP] sm modules: "neutralise" genders
Purpose
=======
Change all masculine nouns in Odoo's code to neutral nouns (when
possible), making sure that demo data is correctly handled. This is
particularly important since our code is open source, and nowadays lots
of machine learning models are trained on open source repositories.

With this small change we contribute to training more "fair" models, and
teaching models that "employee" or "user" != "he".

This also affects some text visible by the user, hence making it more
inclusive for Odoo users.

Task-2853046

closes odoo/odoo#91292

Related: odoo/enterprise#27302
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-16 10:09:32 +02:00
Pierre-Yves Dufays a14efdd0a6 [FIX] Survey: fixes 404 survey management end page + fullscreen
Set the survey in fullscreen (without the ribbon) and fixes the 404 page when
refreshing the survey management end page.

The end page has also been slightly modified by:
- hiding the header because it only contains relevant information when the
survey is running (link to join, number of person having answered the current
question, ...)
- hiding previous arrow which were not working (as the session is closed)
- hiding the next arrow which is not relevant and wasn't working

Task-2791044

closes odoo/odoo#90225

X-original-commit: dd6b007e174c19aeb45c1530aff987c393e36f70
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-02 14:49:58 +02:00
Kevin Baptiste 80c662f808 [IMP] survey: hide website navbar
The website navbar was showing again, whilst it should not.

Taskid: 2738082
Part-of: odoo/odoo#85479
2022-04-01 13:37:08 +02:00
stefanorigano (SRI) c9d58ecca4 [IMP] web,*: o_cursor_default utility-class
This commit is part of v16 overall restyle, task-2704984.

task-2797245

closes odoo/odoo#86626

Related: odoo/enterprise#25365
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-03-21 14:01:03 +01:00
Aurélien Warnon b2e56259cb [IMP] survey: allow un-ticking choices
For surveys, we want to allow the end-user to un-tick an option he had ticked
before, for any kind of questions with choices (simple / multi-choices and
matrix).

e.g: You select an option but on second thoughts you're unsure it's the right
answer, you want to be able to remove your answer.

Especially if the question is not mandatory and you loose points if you don't
answer correctly.

Since the base browser behavior does not allow un-ticking a previously ticked
radio input, we have to play around a bit with specific classes.

Task-2727592

closes odoo/odoo#82272

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-22 18:29:31 +00:00
Fabien Pinckaers 10a5796d4b [IMP] speed up load_menus() by using SVG icons instead of png
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.

Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)

closes odoo/odoo#84280

Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-02-12 08:55:18 +00:00
Christophe MonniezandElisabeth Dickinson dd3ce8cf26 [FIX] survey: replace fonts with unclear license
In ae4435af, two fonts were added without a clear licensing.
With this commit, they are replaced with more recent and better fonts
with a clear OFL license.

closes odoo/odoo#84223

X-original-commit: bec81ca1870f0dcedcc781a7dbb907bdade78e69
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2022-02-09 06:30:07 +00:00
Hubert Van de Walle (huvw) 5033198414 [FIX] survey: print all pages from the survey results
Steps to follow

  - Use an odoo instance without the planning app
  - Go to the survey app > feedback form
  - Click on "See results"
  - Print the document with your browser
  -> The output only contains the first page

Cause of the issue

  A height of 100% is set to the html element
  It works with the planning module because this css is present
  https://github.com/odoo/enterprise/blob/ead53fcca721aaa06619b4113707cae3fe086731/planning/static/src/scss/planning_calendar_report.scss#L57-L60

Solution

  Unset the html height property in the survey layout

opw-2724319

closes odoo/odoo#83370

X-original-commit: 2c2f9a13a8251791ea24e93927f9a45e8dda2c14
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-01-26 13:11:06 +00:00
Florian Charlier 84ad766047 [IMP] survey: Improve UI of results statistics
PURPOSE
Various improvements of the results' statistics were required, mainly regarding
* the filtering features that were not clear and impractical
* the way answer scores was reported
* the vertical space taken by questions never answered

Among other smaller changes, the layout of `datetime`-answers questions is
harmonized with the other answer-types (grouped by value), considering that
the "time" part is important and that the "seconds" part bof that time would
only be changed if it is relevant to the question.

SPECIFICATIONS
**Filters**
It is now more convenient to filter surveys based on:
- Whether they are fully completed
- Whether they are passed
- Whether they are failed (last 2 are mutually exclusive, and only available
for scored tests)

A badge is added to show the number of surveys that match each filter option
if chosen. Note that this simple implementation does not allow to show the
number of surveys which would be displayed if the filter was removed, or
replaced, so the badges are not shown once a filter is selected.

The question/answer filters can now be removed individually.
The i.fa-filter elements used to activate them are now always visible, and are
only available for answers that have been selected at least once.

**Scoring**
Scores are added in tables next to the answers instead of as additional lines
below the question caption.

Right answers are now marked in the Graph and Data tabs instead of being simply
listed under the question.

**Unanswered questions**
To make this special case more clear to the user, a discrete alert is added
below the question. The Graph and Table tabs are removed in this case, as they
contain no information. For Multiple choice and Matrix questions, the Table tab
stays visible to show the possible answers available.

*Misc*
To follow common representation, numbers which are equal to integer values will
show as integers in answers and scores (e.g., 30.0 will show as 30), using a
sub-template.

Distinguishing the questions and results from the previous/next ones was
difficult, hence the added margins and discrete lines.

Similarly to other fields, datetime results now display one line per answer
value, with its occurrence.

Stylesheets are cleaned up.

LINKS
Task-2618399

closes odoo/odoo#77522

Related: odoo/upgrade#3168
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-14 13:53:56 +00:00
Aurélien Warnon 0e3463a6cb [FIX] survey: fix shortcut usage
Currently, we allow the user to press CTRL+Enter to force the submission of his
answer for that question when the focus is within a textarea.

However, we do not want to submit the question if CTRL+Arrow-right is pressed
(since you may use CTRL+arrows to navigate within your text).
In the same fashion, we don't want to select "option C" if you use CTRL+C to
copy some text in the textarea.

This commit fixes these use cases by only allowing the shortcut handling when
the focus is within a textarea when the pressed key is 'Enter' (code 13).

Task-2716078

closes odoo/odoo#82203

X-original-commit: 69de8e29053119195266379facb8231ba4f51944
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-01-04 12:06:49 +00:00
Fabio Barbero f1b1286393 [IMP] survey: display final screen in live presentation
Purpose
=======
When presenting a live survey, the page does not give a
confirmation message when the survey ends and stays on the last slide.
A "Thank you!" message is now displayed when the presentation ends.

Task-2700222

closes odoo/odoo#80447

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-14 12:40:04 +00:00
wde-odoo 1fb99d79b1 [IMP] survey: improve survey usability in backend
PURPOSE

This commit globally improves the backend survey module usability, notably by
renaming labels, moving menu items around and cleaning unused features.

SPECIFICATIONS

These changes include (non-exhaustive list):

On questions

  - Changing labels, action helpers and modules description to be clearer;
  - Re-organizing the survey.question form view, notably to clearly distinguish
    fields related to answers and validation options;
  - Removing the "Clean test answers" server action as it can be done through
    a search + unlink;
  - Removing the allow_value_image field as we now always display the
    image field. Users simply choose to let it blank;

On surveys

  - Re-organizing the survey.survey form view fields to get a clear view of
    the various options;
  - automatically update scoring type when checking certification: if not one
    linked to scoring, update to scoring without answers;
  - set create as create_multi to speedup batch creation;
  - Changes ACL rights for user_input_line. Now, only Survey Managers can
    change answers. Survey users keep only a read access on answers, meaning
    changing what customers / people answered is now limited to managers;

Globally

  - Moving menu items and make them visible outside debug mode;
  - Answer recap on print frontend page is now visible whenever a scoring is
    applied, not only for certification, as if scoring is activated seeing
    answers is probably wanted;

Task-2600241

closes odoo/odoo#79813

Related: odoo/upgrade#3033
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-01 18:39:45 +00:00
David Beguin fd75481d52 [IMP] survey: add background option per section
This commit adds the background per section feature.
If the section to display has a background image configured, the background
will be refreshed using that section background image.
If the section has no background, the survey background is used.
The background is refreshed at the same time that the next question is loaded.

To ease technical maintenance and to keep it simple, the background is always
faded out/in at each page change only if there are some sections on the
survey that has a specific background image. If no background image are set on
the survey sections, the background will never be faded out.

Note: The next section to display depends on free text (section with
description) configuration and on conditional questions.
The next section to display can be the next question's section or directly
the next question itself (if the question is a section).

This section's background image implementation works both for the regular
survey form as well as the "live session" mode of the survey module.

Task-2225393

closes odoo/odoo#79156

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-11-30 11:20:45 +00:00
Julien BankenandCarlos Valverde dfffa1ed92 [IMP] survey: add an helper to load a sample survey
When the user opens the survey module for the first time, the user may
find it difficult to create and configure a new survey as there are many
options available. To improve the onboarding experience of the user, we
will provide a new link on the action helper of the survey module (for
the kanban and the list view of the surveys).

When the user clicks on that link, the system will open a new modal. The
user will then be able to choose a sample to load. Each sample will be
pre-configured for specific purposes. We will have:

- A sample for the feedback forms
- A sample for the live presentations
- A sample for the certifications

After loading a sample, the user will be able to adapt it to fit their
needs. Thanks to the samples, the user can create a survey more easily
and more quickly.

task-2670605

closes odoo/odoo#79255

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Co-authored-by: Carlos Valverde <cvs@odoo.com>
2021-11-26 10:31:45 +00:00
Thibault Delavallée d5b688956b [IMP] survey: display a list-kanban when being ungrouped
PURPOSE

When dealing with lot of surveys kanban view is not really optimal and its
state based grouping is not really helpful. Indeed we do not have total of
each coumn and there is not point adding new states, meaning most surveys
hang in the same column. This is not an optimal display.

SPECIFICATIONS

Improve ungrouped display as this is the main usage of surveys. It should
be displayed like a global list view: each card should take the whole
screen (like ``Visitor`` kanban view). Each line contains some "columns"
holding statistics. We notably use a progressbar to display a nice passed
ratio, as well as a many2one avatar widget to make survey enters the era
of amazing wow kanban views.

When grouped, display should be the old one, aka a standard card.

This is done using a small CSS hack: card template actually consists in main
templates related to two displays. Each card style is hidden depending on being
groups or ungrouped. This triggers a class that is used using CSS to hide
irrelevant content.

A ribbon is also added on kanban cards displaying an Archived danger ribbon
when survey is not active anymore. It is therefore coherent with the form
view display that also has a ribbon defined.

An override in website_slides_survey is added to add number of courses using
the survey.

Order is updated so that new surveys are on top. No need to be bloated by
old ongoing surveys when creating new one.

Finally, some labelling is done with answers to be clearer: registered (number
of raw user inputs), completed (finished answers), certified or passed (quiz
with certification activated or not).

Task-2388785

Part-of: odoo/odoo#77227
2021-11-24 14:04:20 +00:00
Aurélien Warnon 77324d5dde [IMP] survey: keep navigation buttons at the same location
This commit slightly adapts the survey navigation buttons to make sure that
they are always positioned at the same spot.

Before this change, if you rapidly click the "back" button a lot of times, when
it disappears, you will misclick the "Odoo" button and land on the Odoo
website, which can be very annoying during a real test with a timer.

Now, we disable the button when it becomes non-clickable instead of removing
it, so that it always stays at the same spot.

Task-2665998

closes odoo/odoo#78513

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-16 10:49:13 +00:00
Didier (did) 1afcc9c368 [IMP] bus, mail, *: improve longpolling bus notification format
* = auth_signup, calendar, im_livechat, snailmail_account, survey, test_mail,
    web_editor, website_crm_iap_reveal, website_livechat

The aim of this PR is to improve/fix various flaws and limitation of the current
API, to make it easier to use and more efficient.

Notification are now defined with 3 distinct parts:

- the channel determines which client(s) should receive it
- the type determines how it should be handled
- the payload determines any extra information helpful for handling it

Channel
=======

Business code
-------------

- Record channel is introduced for ease of subscribing to and sending
  notifications to specific partners, channels, documents, ...
- String channel is still supported (but it is converted internally to the tuple
  channel).
- Tuple channel is still supported without any change (but should be avoided
  whenever possible due to its complex syntax).

The channel is no longer sent to the client. When the channel was used for
business purpose, the information it contained has been moved into either the
new type, or the payload itself.

Technical note
--------------

All channels are now internally converted to the tuple (db, ...) channel, which
is necessary for the platform code (saas/sh).

Internally, the bus.bus table is not changed, type and payload are grouped
together into what was (and still is) called message.

Type
====

Type is introduced to uniformize the way notifications are sent and handled.
All existing notifications already had some kind of manually-built type in them.
This is now officially supported at the bus API.

In client code this will allow (to be done in future commits) to register one
handler per specific type, instead of having to iterate and to filter all
received notifications on every handler.

Payload
=======

Payload (ex message) did not change, it can still be anything depending on
business needs.

Few adaptations:
- When the type was included on the payload, the type has been moved to the new
  type parameter.
- When the channel was used in business code, its data has been copied into the
  payload.

task-1891151

closes odoo/odoo#79201

X-original-commit: 543af27c7d6836ffac9e80ff8490b6ddbd849221
Related: odoo/enterprise#21998
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 16:05:23 +00:00
Fabio Barbero 54909f5339 [IMP] survey: update "Press Enter" tooltip depending on field type
Purpose
=======
Have the "or press CTRL+Enter" (metaKey if it's a mac) shown if the input field selected is a text area, and "or press Enter" otherwise.
Hide the text at the beginning of the survey if it's from mobile.

PR: odoo/odoo/pull/77726
Task-2637120

closes odoo/odoo#77726

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-18 07:56:17 +00:00
dht-odoo 8281b1ecd5 [FIX] survey: display the absolute counter in time limited survey
Before this commit:
Let's consider the following two scenarios while answering time limited survey:

1) attendee's system clock is de-synchronized compared to the real time
2) Odoo server clock is de-synchronized compared to the real time

In any/both of the above cases, it will lead to a wrong timer display, and will
confuse the user and/or make him fail the test because he will think he still has
more time to submit when he does not.

With this commit:
To fix this, we simply get the offset of server UTC time and moment time, and apply
the offset while calculating the time remaining.

Task-2612972

closes odoo/odoo#77419

X-original-commit: 9e9cd045b2899abc5c8e4a92c43ed6eb2eea158a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-29 20:48:25 +00:00
Aurélien Warnon 7c8cb23aae [FIX] survey: avoid crash for misconfigured questions
Currently, if the user configures his survey with questions of type
'simple_choice', 'multiple_choice' and 'matrix', but doesn't configure any
selectable choices, the survey result page can crash.

This is not really a "standard" use case but this commit adds a few checks to
avoid a complete traceback and instead give empty data results.

Task-2622869

closes odoo/odoo#75586

closes odoo/odoo#76606

X-original-commit: 8051be7c96417cf2feb9d542bb3d230022c8cc54
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-09-16 08:36:06 +00:00
52fedc8e91 [IMP] survey: add average duration on survey
Average duration of each survey is added. To avoid performance issues value
is not stored, and calculated with raw SQL. It requires to have an end
datetime on survey user inputs, allowing to compute average duration it
took people to complete survey.

Live surveys now open in a new tab instead of in-place.

Also rename some css / scss files to ease understanding. Remove unnecessary
class on survey form view.

Task-2634805
PR odoo#72298

Part-of: odoo/odoo#72298
Co-authored-by: David Beguin <dbe@odoo.com>
Co-authored-by: Mariska Archielli <ram@odoo.com>
Co-authored-by: Thibault Delavallee <tde@odoo.com>
2021-08-31 23:34:55 +00:00
Aurélien Warnon 9c6c77bcc0 [IMP] survey: allow to force submit with CTRL in textareas
This commit adds the possibility to force the form submission by pressing the
CTRL+Enter keys.

Previously, it was not possible to submit a textarea answer using the keyboard.

Task-2484885

closes odoo/odoo#68310

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-20 09:43:34 +00:00
Aurélien Warnon 8b3c1b36b7 [IMP] survey: add a "performance per section" chart
This commit adds a new chart at the end of a scored survey.

Previously, you could see your "Overall Performance", meaning what was your
percentage of correct/partially correct/incorrect/skipped answers for all
the survey scored questions.

Now, we added a new chart new to it that shows the percentage of
correct/partially correct/incorrect/skipped answers but for each section of the
survey.

This allows the user to see in which section(s) he did the most mistakes.

Task-2484885
2021-04-15 12:32:12 +00:00
Nasreddin (bon) d8244c64d9 [FIX] survey: display right date format in datepicker
Issue

	- Install 'Survey' & 'website' module
	- Enable "es_VE" language and activate on main website
	- Go to Website Homepage
	- Switch to "Spanish (VE)" language (footer)
	- Go to "Survey" module
	- Create a survey:
	- Add a question of type 'Date' then save
	- Click on "TEST" button
	- Start survey and add a date with the datepicker
	- Submit survey

	Error message : 'This is not a date'

Cause

	When submit survey, not using the database date format.

Solution

	When validating form (on submit), check if date is formated
	with database format and (not the moment locale since user can
	alter date and datetime format).

opw-2452237

closes odoo/odoo#71228

X-original-commit: f3c5dd794e4de71187fd7532c39595b2297eb93d
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-05-25 14:39:39 +00:00
Xavier Morel 79a4d11e24 [FIX] *: bunch of mismarked translation specifiers
`_(xyz)` will wrap them in an underscore.js object, which when used in
a string context will just return the string. So it's basically a
no-op, but it certainly doesn't translate the terms.

closes odoo/odoo#70476

X-original-commit: 92352ed2b5524c97b0aeeba3193c6a8d93ed82a1
Related: odoo/enterprise#18172
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-06 12:06:22 +00:00