Odoo's Mergebot b3b4a793f8 [REF] survey : use js widget and simplify validation and submit flow
PURPOSE

Purpose of this PR is to standardize and update JS code of the survey
application. It impacts mainly save, pagination and validation flows
when taking surveys.

Python code will have to be adapted consequently.

SPECIFICATIONS: UDPATE WIDGETS

Update JS code remove global selectors / global JS and use standard
widgets. Lessen number of RPCs and clean old code for prefilling and
validation of surveys.

Contains update of notably

  * Survey Form: make it a real widget calling routes in RPC and
    doing some validation;
  * Prefill is now handled in the template instead of in js controller;
  * Submit is now done in json rpc;
  * Survey Timer: make timer a real widget;
  * Survey Result Analysis: make result, graph and pagifation
    real widgets;
  * Charts handling have been externalised in a sub widget;
  * Pagination have been externalised in a sub widget;

Clean Prefill: prefill can be done directly in the template as the template
has already all the needed values (in answer object).

Clean Validation: validation is done at server side and is independent
from prefilling values.

Dates: dates are now formatted directly in the template at rendering using
a format_date fonction pointer called in the template.

Don't use widget in review mode: remove o_survey_form class from review
template as only dates were processed in the widget for review template.

Breadcrumb: remove button previous, prev=prev and go_back mechanism.
The previous page is handled by the breadcrump. Remove redirect url
mechanism. Breadcrumb now saves the answers when going to a previous page.
Move o_survey_form class to a higher div to englobe breadcrumb in the widget
and ease his handling.

Modify the route type of survey submit to work in json. The js survey form
controller calls now manually the route via rpc.

SPECIFICATIONS: UDPATE CONTROLLERS

Refactor questions naming, validation and save flow. Simplify the answer_tag
and question name by removing the survey_id (uses now only question id)
for the most simple cases.

Factorise the save and validate survey answers to avoid duplicate code.

Review posted submit data :

  * process all questions by question type (instead of using form data
    (key,value) that needed key parsing and was un-typed)
  * regroup answers by questions and adapt all validation and save flow
  * remove post data in save and validate question methods
    and uses directly the answer(s)
  * remove useless input names

Validation and submit functions have been rewritten to avoid
duplicated code as many question types have quite the same
validation and save process.

SPECIFICATIONS: MISC

Partial Forward Port : Web assets have been split into another
template to avoid multiple load of those assets when website is
installed.

Also reset is_time_limited on scoring type change.

Also remove locale load as already done in session.js#load_modules

See sub commits for more details.

Task ID 1930132
Closes PR #32419

closes odoo/odoo#39501

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-19 17:57:58 +01:00
2019-11-19 09:15:22 +00:00
2019-11-19 09:16:32 +00:00
…
2019-10-03 12:48:09 +00:00
…
…
…
2019-11-08 11:24:04 +00:00
2019-10-03 12:48:09 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%