Skip to content
Snippets Groups Projects
  1. Dec 09, 2019
  2. Dec 03, 2019
  3. Nov 28, 2019
  4. Nov 26, 2019
  5. Dec 02, 2019
  6. Dec 08, 2019
    • Romain Derie's avatar
      [IMP] web_editor, *: add new zone in left panel to handle invisible DOM · 1915fe35
      Romain Derie authored
      
      * website, website_mass_mailing
      
      We only have one invisible snippet (newsletter popup) which is handled
      by adding a yellow alert in the DOM in edit mode to be able to click
      somewhere to open the snippet options.
      
      As we will add some new invisible snippet (generic popup, cookies bar,
      and probably more) this needed to be improved.
      
      Now, any snippet having the `o_snippet_invisible` class will have an
      entry in the left panel in a dedicated zone to edit itself. This also
      allows to get rid of the yellow alert, making sure that "what you see
      is what you get" in the editor zone.
      
      task-2150966
      
      closes odoo/odoo#41420
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      1915fe35
  7. Dec 06, 2019
  8. Dec 05, 2019
  9. Dec 06, 2019
    • Romain Derie's avatar
      [IMP] web_editor, website: add new 'Countdown' snippet · 699890d3
      Romain Derie authored
      
      This commit introduces a new snippet: Countdown.
      
      The countdown snippet is composed of 4 circle countdown, one for every time
      unit: seconds, minutes, hours and days.
      
      When countdown ends, the user can chose between 3 possible actions:
      1. Nothing
      2. Show message: show a message once the countdown ends.
         The message will be displayed bellow the countdown (stopped on 0) or will
         replace the countdown depending on the option selected.
         The message can be edited through the website builder.
      3. Redirect: redirect the user to the chosen URL. If the user is on the page at
         the exact moment the countdown reach 0, the user will be redirected
         automatically. If the user lands on the page after the countdown has reached
         0, there will be no redirection and the link will be shown bellow the
         countdown (stopped on 0) or will replace the countdown depending on the
         option selected.
      
      The countdown layout can be customized in multiple ways:
      1. By choosing to hide some time units. For instance, seconds can be hidden or
         only days shown.
      2. By changing its size between small/medium/large.
      3. By changing its basic design (circle, boxes, clean).
      4. By changing its advanced design (shape, background, progress bar..)
      
      task-2093081
      
      closes odoo/odoo#39773
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      699890d3
    • qsm-odoo's avatar
      [FIX] web_editor: fix traceback on left panel input click · 75ebe511
      qsm-odoo authored
      
      I removed a handler without removing the event binding by mistake...
      
      closes odoo/odoo#41481
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      75ebe511
  10. Dec 05, 2019
    • qsm-odoo's avatar
      [REF] website: call _post_copy with website in the context directly · 322d5768
      qsm-odoo authored
      
      Before this commit, the website was given as a parameter of the
      _post_copy function which is called after theme install. It was then
      transfered through the context when calling the theme sub' post_copy
      function.
      
      It makes actually more sense to directly call the _post_copy function
      with the right website in the context instead of a parameter. This will
      also allow to call enable_view/disable_view in the default post_copy
      common to all theme, with the right website.
      
      closes odoo/odoo#41312
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      322d5768
  11. Dec 06, 2019
  12. Dec 02, 2019
  13. Dec 06, 2019
    • Xavier Morel's avatar
      [FIX] hr_maintenance: remove dynamic domain · d3798b40
      Xavier Morel authored
      
      * converts dynamic domain from onchange_department_or_employee_id to a
        static domain on the field
      * remove the department_id field (and all uses of it), it looks to
        never be set and not really be settable: the field is hidden in the
        form, doesn't have a default value, does not have anything to
        compute it, ...
      * remove the onchange itself as it has very little value: it
        auto-selects an equipment if there exists a single equipment
        assigned to the selected employee or to no employee
      
        Even if we removed the "equipment not assigned to any user"
        bit (under the assumption that people would mostly request
        maintenance for their own equipment, and that this would usefully
        trigger more often) it's unlikely for dedicated users of
        hr_maintenance to assign only one equipment per employee. So the
        onchange would rarely do any useful work, and what work it saves is
        trivial: if there's only one equipment the employee could ask about
        for maintenance it's really trivial to do that.
      
      Task 2115472
      
      closes odoo/odoo#40963
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      d3798b40
  14. Dec 05, 2019
    • Odoo's Mergebot's avatar
      [MERGE] survey: clean and rename models, refactor survey results page code · 374b57a1
      Odoo's Mergebot authored
      
      PURPOSE
      
      As new features are about to land in survey, notably live interactions [1]
      and new survey building [2] performing a pre cleaning is necessary. In this
      PR we clean survey models by: removing unnecessary fields, cleaning some code
      and finally renaming models.
      
      SPECIFICATIONS
      
      [REF] survey: remove unused or unnecessary fields to clean models. Some fields
      are also renamed to better indicate their use.
      
        * On survey.survey, remove question field, unnecessary related on title.
        * On survey.survey, remove unused category field.
        * On survey.user_input, remove input_type and its garbage collect.
        * On survey.{survey, user_input}, remove url fields replaced by methods
      
        * On survey.survey, rename thanks_you_message to description_done
        * On survey.survey, rename certificate field to certification
        * On survey.survey, rename passing_score field to scoring_success_min
        * On survey.user_input, rename quiz_score field to scoring_percentage
        * On survey.user_input, rename quizz_passed field to scoring_success
        * On survey.user_input, rename token field to access_token
        * On survey.user_input, rename question_ids field to predefined_question_ids
      
      [REF] survey: rename some models to ease understanding
      
      In this merge we rename the long standing ``survey.label`` model. Indeed
      a label is something before a question, like an input label. Labels in survey
      are used for suggested answers and sometimes as rows for matrix answers.
      
      After much thoughts we rename ``survey.label`` to ``survey.question.answer``.
      It indicates this model holds answers. Moreover it is namespaced within the
      ``survey.question`` model name to avoid conflict with user input / user answer
      model.
      
      As model naming changes, some fields also evolve. In survey.question model
      
        * ``labels_id`` is renamed to ``suggested_answer_ids`` to indicate it is
          used to display suggested values to the user;
        * ``labels_id_2`` is renamed to ``matrix_row_ids`` to indicate it is used
          to generate the rows of the matrix-type question. A matrix is therefore
          done using ``matrix_row_ids`` for rows and ``suggested_answer_ids`` for
          columns which seems easier to understand;
      
      In survey.question.answer (old survey.label) model
      
        * ``question_id_2`` is renamed to ``matrix_question_id`` to ease its
          understanding, notably that it is used for matrix questions;
      
      Main user answer model is ``survey.user_input``. It holds lines related to
      answers given to specific questions. In this commit we rename this model from
      ``survey.user_input_line`` to ``survey.user_input.line`` to be coherent with
      general odoo naming guidelines.
      
      [REF] survey: on survey.user_input.line, rename value_suggested{_row}
      
      A new naming recently introduced for ``survey.question.answer`` has been
      recently introduced: ``suggested_answer_ids`` and ``matrix_row_ids``. In
      this commit we propagate that naming to survey.user_input.line model. New
      naming is
      
        * ``suggested_answer_id``: one chosen value for single / multiple choice.
          It is also used for matrix columns as those indicates the value to give
          on a given row;
        * ``matrix_row_id``: the related row of the suggested answer for matrix
          questions;
      
      It adds two benefits
      
        * it finishes by _id which is always a good idea for m2o fields;
        * it better indicate the use;
      
       [REF] survey: on survey.{question,user_input.line}, make type and field names match
      
      To better understand question type and their input type, we update some of
      ``survey.question`` ``question_type`` keys :
      
        Type----Old type-----New type
      
        text----free_text----text_box
        char----textbox------char_box
      
      Untouched question types: ``numerical_box``, ``date``, ``datetime``,
      ``simple_choice``, ``multiple_choice``, ``matrix``. Those are already
      understandable.
      
      Then ``survey.user_input.line`` ``answer_type`` keys are also updated to
      match their question type counterparts
      
        QuestType--------Old type-----New type
      
        text_box---------free_text----text_box
        char_box---------text---------char_box
        numerical_box----number-------numerical_box
      
      Then ``survey.user_input.line`` fields used to store the value are updated to
      propagate the new naming
      
        AnswerLineType----Old field----------New field
      
        text_box----------value_free_text----value_text_box
        char_box----------value_text---------value_char_box
        numerical_box-----value_number-------value_numerical_box
      
      Untouched answer types and field storing value: ``date``, ``datetime`` still
      refer to same question type and use value_date / value_datetime fields.
      ``simple_choice``, ``multiple_choice`` and ``matrix`` still use ``suggestion``
      answer type and ``suggested_answer_id`` (+ ``matrix_row_id``) to store link
      to ``survey.question.answer`` records.
      
      [REF] survey: refactor results page
      
      Purpose of this merge is to globally rewrite the way statistics are
      pre computed and used in results page of surveys. Indeed current code is
      very complex, having a lot of calls to the same methods while taking only
      part of its results. It also have a mix of model and controller methods,
      data is computed several times a bit differently, ...
      
      In this commit we rewrite that part. Including
      
        * a simpler code flow;
        * a simpler data structure;
        * use a better naming for methods instead of "prepare_results" called
          randomly within the code and re-using part of its returned content;
        * use record sets / records instead of giving sub-elements of a record
          like question.title, label.value, ...
      
      Data structure
      
        * simply give a question_and_page_ids to the template that will iterate
          on pages / questions;
        * have a graph_data, table_data dictionaries available for graph and
          table display with simple entries;
        * graph_data: holding all necessary but minimalist data for graph display
          if question allows it;
        * table_data: holding all necessary but minimalist data for table / summary
          display;
        * hold record sets of done / failed answers and answer lines;
      
      In this commit we also simplify and clean pagination in survey graph results
      
        * remove page_range helper tool that can be inlined in the templates
          directly, doing a simple range;
        * fix and improve pagination code;
      
      [IMP] survey: improve demo data
      
      Add a new demo survey about a quiz: a survey with scoring but no certificate.
      Have almost all possible combinations of questions and options (notably choices
      to have a scoring) and answer lines in order to be able to, notably, debug
      the statistics / result page.
      
      LINKS
      
      [0] Related to Task ID 2061901 (survey models cleaning and preparation)
      [1] Task ID 1972640 (live interactions)
      [2] Task ID 2119587 (new frontend for building surveys)
      
      PR #40765
      
      closes odoo/odoo#41198
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      Unverified
      374b57a1
    • Thibault Delavallée's avatar
      [IMP] survey: improve demo data · f7fb9b96
      Thibault Delavallée authored
      PURPOSE
      
      As new features are about to land in survey, notably live interactions [1]
      and new survey building [2] performing a pre cleaning is necessary. In this
      PR we clean survey models by: removing unnecessary fields, cleaning some code
      and finally renaming models.
      
      SPECIFICATIONS
      
      Add a new demo survey about a quiz: a survey with scoring but no certificate.
      Have almost all possible combinations of questions and options (notably choices
      to have a scoring) and answer lines in order to be able to, notably, debug
      the statistics / result page.
      
      LINKS
      
      [0] Related to Task ID 2061901 (survey models cleaning and preparation)
      [1] Task ID 1972640 (live interactions)
      [2] Task ID 2119587 (new frontend for building surveys)
      
      PR #40765
      f7fb9b96
    • Thibault Delavallée's avatar
      [REF] survey: clean results page and its code generating statistics · 351a4439
      Thibault Delavallée authored
      PURPOSE
      
      As new features are about to land in survey, notably live interactions [1]
      and new survey building [2] performing a pre cleaning is necessary. In this
      PR we clean survey models by: removing unnecessary fields, cleaning some code
      and finally renaming models.
      
      SPECIFICATIONS
      
      Purpose of this commit is to globally rewrite the way statistics are
      pre computed and used in results page of surveys. Indeed current code is
      very complex, having a lot of calls to the same methods while taking only
      part of its results. It also have a mix of model and controller methods,
      data is computed several times a bit differently, ...
      
      In this commit we rewrite that part. Including
      
        * a simpler code flow;
        * a simpler data structure;
        * use a better naming for methods instead of "prepare_results" called
          randomly within the code and re-using part of its returned content;
        * use record sets / records instead of giving sub-elements of a record
          like question.title, label.value, ...
      
      Data structure
      
        * simply give a question_and_page_ids to the template that will iterate
          on pages / questions;
        * have a graph_data, table_data dictionaries available for graph and
          table display with simple entries;
        * graph_data: holding all necessary but minimalist data for graph display
          if question allows it;
        * table_data: holding all necessary but minimalist data for table / summary
          display;
        * hold record sets of done / failed answers and answer lines;
      
      In this commit we also simplify and clean pagination in survey graph results
      
        * remove page_range helper tool that can be inlined in the templates
          directly, doing a simple range;
        * fix and improve pagination code;
      
      LINKS
      
      [0] Related to Task ID 2061901 (survey models cleaning and preparation)
      [1] Task ID 1972640 (live interactions)
      [2] Task ID 2119587 (new frontend for building surveys)
      
      PR #40765
      351a4439
    • Thibault Delavallée's avatar
      [FIX] survey: lint JS files and reorganize route code · bb3d4634
      Thibault Delavallée authored
      PURPOSE
      
      As new features are about to land in survey, notably live interactions [1]
      and new survey building [2] performing a pre cleaning is necessary. In this
      PR we clean survey models by: removing unnecessary fields, cleaning some code
      and finally renaming models.
      
      SPECIFICATIONS
      
      This commit lints JS files located in survey as some typos and mistakes
      were recently introduced. Code related to routes is also slightly reorganized
      to better understand file main sections.
      
      LINKS
      
      [0] Related to Task ID 2061901 (survey models cleaning and preparation)
      [1] Task ID 1972640 (live interactions)
      [2] Task ID 2119587 (new frontend for building surveys)
      
      PR #40765
      bb3d4634
    • Thibault Delavallée's avatar
      [REF] survey: on survey.user_input{.line}, reorganize and clean model code · a6e9ee91
      Thibault Delavallée authored
      PURPOSE
      
      As new features are about to land in survey, notably live interactions [1]
      and new survey building [2] performing a pre cleaning is necessary. In this
      PR we clean survey models by: removing unnecessary fields, cleaning some code
      and finally renaming models.
      
      SPECIFICATIONS
      
      In survey.user_input.line, clean code about constraints. Purpose is to make
      it easier to read and understand.
      
      Code creating user input lines is moved from survey.user_input.line model to
      survey.user_input. Indeed it is now based on a user_input record, and create
      answer line related to a question, based on values coming from controllers
      (and therefore frontend). It makes more sense to delegate that code to the
      user_input model itself that creates its lines. Code is also rewritten to
      be cleaner and easier to read.
      
      Code computing statistics on user input records is moved from survey model
      to user_input model, where it belongs. Missing translation marks are added
      because translations matter.
      
      LINKS
      
      [0] Related to Task ID 2061901 (survey models cleaning and preparation)
      [1] Task ID 1972640 (live interactions)
      [2] Task ID 2119587 (new frontend for building surveys)
      
      PR #40765
      a6e9ee91
    • Thibault Delavallée's avatar
      [REF] survey: on survey.{question,user_input.line}, make type and field names match · 0406b704
      Thibault Delavallée authored
      PURPOSE
      
      As new features are about to land in survey, notably live interactions [1]
      and new survey building [2] performing a pre cleaning is necessary. In this
      PR we clean survey models by: removing unnecessary fields, cleaning some code
      and finally renaming models.
      
      SPECIFICATIONS
      
      To better understand question type and their input type, we update some of
      ``survey.question`` ``question_type`` keys :
      
        Type----Old type-----New type
      
        text----free_text----text_box
        char----textbox------char_box
      
      Untouched question types: ``numerical_box``, ``date``, ``datetime``,
      ``simple_choice``, ``multiple_choice``, ``matrix``. Those are already
      understandable.
      
      Then ``survey.user_input.line`` ``answer_type`` keys are also updated to
      match their question type counterparts
      
        QuestType--------Old type-----New type
      
        text_box---------free_text----text_box
        char_box---------text---------char_box
        numerical_box----number-------numerical_box
      
      Then ``survey.user_input.line`` fields used to store the value are updated to
      propagate the new naming
      
        AnswerLineType----Old field----------New field
      
        text_box----------value_free_text----value_text_box
        char_box----------value_text---------value_char_box
        numerical_box-----value_number-------value_numerical_box
      
      Untouched answer types and field storing value: ``date``, ``datetime`` still
      refer to same question type and use value_date / value_datetime fields.
      ``simple_choice``, ``multiple_choice`` and ``matrix`` still use ``suggestion``
      answer type and ``suggested_answer_id`` (+ ``matrix_row_id``) to store link
      to ``survey.question.answer`` records.
      
      LINKS
      
      [0] Related to Task ID 2061901 (survey models cleaning and preparation)
      [1] Task ID 1972640 (live interactions)
      [2] Task ID 2119587 (new frontend for building surveys)
      
      PR #40765
      0406b704
    • Thibault Delavallée's avatar
      [REF] survey: on survey.user_input, rename question_ids field to predefined_question_ids · 2a35d92b
      Thibault Delavallée authored
      PURPOSE
      
      As new features are about to land in survey, notably live interactions [1]
      and new survey building [2] performing a pre cleaning is necessary. In this
      PR we clean survey models by: removing unnecessary fields, cleaning some code
      and finally renaming models.
      
      SPECIFICATIONS
      
      ``question_ids`` field name is quite difficult to understand as we wonder why
      there is such a field on user input model. As its purpose is to store questions
      user has to answer (randomly chosen or all chosen) let us rename it to
      ``predefined_question_ids``.
      
      Moreover starting from now on if it is now given at create it is automatically
      computed. Classic flows go through ``survey._create_answer()`` method that
      prepares them accordingly. However tests or demo data do not necessarily go
      through that method and it makes scoring fail (notably) if people forget
      to define them.
      
      Let us automatically generate them at user input create if not given.
      
      LINKS
      
      [0] Related to Task ID 2061901 (survey models cleaning and preparation)
      [1] Task ID 1972640 (live interactions)
      [2] Task ID 2119587 (new frontend for building surveys)
      
      PR #40765
      2a35d92b
    • Thibault Delavallée's avatar
      [REF] survey: on survey.user_input.line, rename value_suggested{_row} fields · 3a094f22
      Thibault Delavallée authored
      PURPOSE
      
      As new features are about to land in survey, notably live interactions [1]
      and new survey building [2] performing a pre cleaning is necessary. In this
      PR we clean survey models by: removing unnecessary fields, cleaning some code
      and finally renaming models.
      
      SPECIFICATIONS
      
      A new naming for ``survey.question.answer`` has been recently introduced:
      ``suggested_answer_ids`` and ``matrix_row_ids``. In this commit we propagate
      that naming to survey.user_input.line model. New naming is
      
        * ``suggested_answer_id``: one chosen value for single / multiple choice.
          It is also used for matrix columns as those indicates the value to give
          on a given row;
        * ``matrix_row_id``: the related row of the suggested answer for matrix
          questions;
      
      It adds two benefits
      
        * it finishes by _id which is always a good idea for m2o fields;
        * it better indicates the use;
      
      LINKS
      
      [0] Related to Task ID 2061901 (survey models cleaning and preparation)
      [1] Task ID 1972640 (live interactions)
      [2] Task ID 2119587 (new frontend for building surveys)
      
      PR #40765
      3a094f22
Loading