Skip to content
Snippets Groups Projects
  1. Dec 24, 2019
    • Patrick Hoste's avatar
      [IMP] website_slides: add comments on answers showed after answering a quiz · e42ee496
      Patrick Hoste authored
      
      PURPOSE :
      
      A quiz after a course content is a good way to check if the user gets the previous lesson.
      Despite, the user/student may not understand why his answer was wrong/correct.
      In this task we'll allow the teacher to add a comment next to the asnwer of a quiz.
      
      SPECIFICATION :
      
      The quiz creator will now be able to comment the answers to inform the frontend user why
      his answer is wrong/correct. He will be able to add the comments both in backend and frontend.
      
      Task ID : 2072566
      PR : #41188
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      e42ee496
  2. Dec 20, 2019
    • Debauche Stéphane's avatar
      [IMP] website_slides: improve error message when google API key is invalid · 01dadaec
      Debauche Stéphane authored
      
      Currently when there is an issue with the google API key, a generic message
      is send to the user, with the error details embedded in it in an ugly way.
      
      Now a message is displayed: "Your Google API key is invalid, please update it
      into your settings. Settings > Website > Features > API Key". This is done
      by parsing the JSON google sends back after request and determining if the
      error is linked to the API key.
      
      Task #2082857
      
      closes odoo/odoo#40547
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      01dadaec
    • Thibault Delavallée's avatar
      [FIX] website_slides: fix wrong comodel name in many2many · 4ef326de
      Thibault Delavallée authored
      
      Channels uses tags allowing to categorize and filter content. For that
      purpose a m2m exists between channels (slide.channel) and tags (slide.channel
      .tag). The 2many relationship from tags to channels holds however a wrong
      comodel name. It has no impact on code since relationship table is
      correctly defined and current code does not use the channel_ids fields
      from tags.
      
      closes odoo/odoo#42244
      
      X-original-commit: 46c3ac94485292c59fdfe4b21a8e32eef9d1f998
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      4ef326de
  3. Dec 18, 2019
  4. Dec 12, 2019
    • Aurélien Warnon's avatar
      [FIX] website_slides: fix slide.slide statistics compute method · 648bbbec
      Aurélien Warnon authored
      
      The slide.slide and slide.channel "_compute_slides_statistics" methods do not
      always assign a default value for the "total_slides" field.
      
      This can cause some CacheMiss and seem related to nondeterministic errors on
      the runbot.
      
      Task#2123711
      Runbot build error ID 247
      
      closes odoo/odoo#41942
      
      X-original-commit: c240d04e
      Signed-off-by: default avatarawa-odoo <awa-odoo@users.noreply.github.com>
      648bbbec
    • mcm-odoo's avatar
      [REF] website_slides: define specific eLearning user groups · 90bf317c
      mcm-odoo authored
      
      PURPOSE
      
      Have user groups specific to eLearning to separate them from generic website
      editors. Indeed this is a specific work area and require more than pure design
      skills.
      
      SPECIFICATIONS
      
      Two user groups are added in this commit
      
        * group_website_slides_officer
      
          + can read any course/slide
          + can create a course (will be responsible)
          + can write on its courses
          + can upload slides to the courses he is responsible
          + can publish slides to the courses he is responsible
          - cannot unlink courses/slides (you should archive them)
      
          * implies group_website_publisher in order to see the top navbar in
            frontend with the publish toggle button and the new content button;
      
        * group_website_slides_manager: has full rights
      
          + can read any course/slide;
          + can create a course;
          + can add slide to any courses;
          + can publish any courses/slides;
          + can unlink any courses/slides;
          + has access to reporting menu entries;
      
      Rights for other groups are untouched for courses / slides. As a reminder
      we still support responsibles being outside of eLearning groups, for example
      if an employee is a teacher that handles a course:
      
        * people in upload_group_ids of a channel can upload slides, even if they
          don't belong to any eLearning group;
        * people responsible of a course can upload and publish slides even if they
          don't belong to any eLearning group (done through controller as they
          don't have real rights on underlying models);
      
      We choose to keep the survey rights separated from eLearning ones. Indeed
      it is easy in odoo to update the imply_ids field of groups if necessary
      to link survey / eLearning groups; default user template can also be updated
      easily. Standard Odoo should therefore correctly separate those groups. The
      only specific rights is that eLearning officers can read all surveys, allowing
      to choose them for certification-based courses.
      
      LINKS
      
      Task ID 2062462
      PR #39485
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      90bf317c
  5. Dec 02, 2019
    • Thibault Delavallée's avatar
      [REF] {website_}mail: move and replace published field of mail.message to is_internal · 5649fc88
      Thibault Delavallée authored
      PURPOSE
      
      Clean posting process and improve mail.message definition and comprehension.
      
      SPECIFICATIONS
      
      Website mail defines a website_published field allowing to publish / unpublish
      comments on the frontend of some modules. This field has several drawbacks :
      
        * it is used only for front-end people (portal, public) and has no real
          effect in chatter / classic discussions;
        * it is used only in some advanced front-end module and is not available
          in portal by default;
        * its naming is not really correct as it is not linked to fields coming
          from the website_published mixin and its behavior is not really
          the same;
        * its use is a bit duplicated with internal flag coming from subtype
          allowing to hide messages related to an internal subtype;
        * there are overrides of standard mail.message methods just to handle
          this flag;
      
      In this commit we change that field by an is_internal flag directly on
      mail.message model itself. It tells if share people (customers, share users)
      are allowed to read the message. This field can be given through posting
      API or set manually using widgets. It is also used in access rights custom
      methods and managed like the internal flag of subtypes.
      
      Mailgateway was already using an internal flag for internal note replies. It
      is renamed to is_internal and propagated as it is now a standard field. It
      also eases code understanding.
      
      Portal is updated to allow managing the flag directly. It means customer portal
      now natively allows to moderate customer comments without any need of website
      modules.
      
      Rating is updated accordingly. An is_internal field is added, replacing the
      related on website published.
      
      LINKS
      
      Task ID 2071556
      PR #38692
      5649fc88
    • Thibault Delavallée's avatar
      [REF] mail, various: rename subtype parameter of message_post to subtype_xmlid · e2b33f46
      Thibault Delavallée authored
      PURPOSE
      
      Clean posting process and improve mail.message definition and comprehension.
      
      SPECIFICATIONS
      
      In order to be more explicit subtype parameter is renamed to subtype_xmlid.
      It therefore clearly indicates it should be a valid subtype Xml ID. Support
      of ill formatted Xml IDs is removed because there is no reason to try to
      add some random prefix. Give something that exists or go to hell, punk !
      
      LINKS
      
      Task ID 2071556
      PR #38692
      e2b33f46
  6. Nov 29, 2019
    • Thibault Delavallée's avatar
      [REF] mail, various: improve mail creation calls, notably author and email from default computation · 1838191e
      Thibault Delavallée authored
      Purpose of this commit is to correctly compute author_id and email_from
      in mail_message and mail_mail as they depends from each other. Moreover it
      is a good idea in various flows to specify email and author when giving
      creation values to avoid default computation that is not always guaranteed to
      be accurate notably when involving super user.
      
      Mail message creation could lead to desynchronized values between author
      and email_from. This is improved with this commit by correctly inheriting
      from default_get and computing both of them at the same time instead of having
      two default values. Indeed they depend on each other.
      
      Same thing is done for mail composer. Mail Thread offers a tool method to
      find email_from / author_id based on having one of those values or current
      user and it is called whenever necessary.
      
      Some calls to mail template send_mail are also cleaned.
      
      Task ID 1853147
      PR #32243
      1838191e
    • Thibault Delavallée's avatar
      [IMP] mail: add computed fields for company emails · b9a22d2f
      Thibault Delavallée authored
      Purpose of this commit is to give a way to access to company email and catchall
      with formatting. Those will be used in various automated emails. Indeed
      currently several templates use either ``company_id.partner_id.email``,
      ``company_id.email``, or even don't provide fallback values.
      
      With this commit from a company record people will be able to use
      
        * a correctly formatted catchall: ``"My Company Name"
          <catchall_alias@catchall_domain>``
        * an email_formatted field like partner email_formatted that is either its
          partner-related email_formatted value, or formatted catchall if its partner
          is not correctly configured;
      
      Various calls to mail creation are updated accordingly.
      
      Task ID 1853147
      PR #32243
      b9a22d2f
    • Hoste Patrick's avatar
      [IMP] website_slides: allow to create and update quizzes directly in frontend · ec9e389f
      Hoste Patrick authored
      
      Purpose is to ease designing your courses by allowing to create and update
      slide quiz directly in frontend, within the slide display.
      
      With this commit you are able to
      
        * add a quiz to a slide or add a question to an existing quiz;
        * edit an existing question from a quiz:
      
         * change the title of the Question;
         * add, remove or update answers;
         * change the right answer;
         * delete an existing question;
         * reorder the questions from a quiz;
         * reset the quiz for the current user if he is a website designer, allowing
           to test the quiz and its answers;
      
      New frontend widgets are introduced allowing to manipulate quiz. Slide page
      now supports a readonly / taking quiz mode and an edit mode for quizzes
      used notably for website designers / course maintainers.
      
      Task ID : 1999636
      PR : #35326
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      ec9e389f
    • Thibault Delavallée's avatar
      [IMP] website_slides: merge slide quiz answers constraints in a single method · a4abdfa3
      Thibault Delavallée authored
      Currently there are several checks on answer integrity for slide quiz
      questions. In this commit we simplify code to effectively implement
      what is requested: 1 valid answer and at least 1 invalid answer.
      
      Task ID 1999636
      PR #35326
      a4abdfa3
  7. Nov 25, 2019
  8. Nov 22, 2019
  9. Nov 21, 2019
    • Florimond Husquinet (fhu)'s avatar
      [IMP] website_slide: add a card description independent from short description · 07f70e3c
      Florimond Husquinet (fhu) authored
      
      The Channel model contains the two following fields: `description` and
      `description_html`. The former is a short plain-text description that can be
      filled in the creation form. The latter is a long html-formatted description.
      
      Before this commit:
      
      The description displayed on the card of the course is the `description` field.
      
      After this commit:
      
      There is an additional `description_short` field, which is initialized to the
      same value as the `description` field. If the `description` field is modified
      the `description_short` reflects the modifications. This happens however only
      if the user didn't modify the `description_short` field manually. If it is
      modified to another value manually, the link is broken.
      
      Description short is now used only on the course page, below title, in the
      header. Description short is used in kanban card displayed in homepage.
      Html description is used as a long course description on course page.
      
      Beside, in the creation form of a course, the description textarea is now a
      one-line input field to reflect the fact that it's supposed to be a relatively
      short description.
      
      Task ID: 2026165
      PR #39388
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      07f70e3c
  10. Nov 20, 2019
  11. Nov 19, 2019
    • ryv-odoo's avatar
      [REF] rating, various: improve rating.rating ACLs · c7a1a2d9
      ryv-odoo authored
      
      PURPOSE
      
      Rating model should be available only for internal users. External users
      access them only through dedicated routes or controllers using sudo and/or
      granting access through tokens. Therefore simplifying ACLs should be feasible.
      
      SPECIFICATIONS
      
      Remove access to rating.rating for public and portal users. Only employees
      can access it, with full access given to system admins.
      
      Update various functional flows to use sudo() and check that access is
      verified before using sudo.
      
      Impacted modules
      
        * rating / mail: add groups on some rating related fields as only
          internal users should access them now;
        * rating / mail: set some statistics fields using compute_sudo as their
          value should be accessible for external people even without access to
          the underlying rating.rating records;
        * project: makes some use of rating and has to be updated, notably for
          the public rating page;
        * website_{livechat, rating, slides}: add sudo in public routes as access
          is already granted;
        * website_slides: set statistics field using compute_sudo as their
          value should be accessible for external people;
      
      TASK ID 2053096
      PR #36592
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      c7a1a2d9
  12. Nov 14, 2019
  13. Oct 23, 2019
    • mcm-odoo's avatar
      [IMP] website_slides: add progressbar and completed tag · 42a24e41
      mcm-odoo authored
      
      - Teacher can now see the progress of his students on the attendees' list.
      
      - The completion of a course was recomputed even if the course is completed
        now it's fixed to 100 when completed.
      
      - Added a progressbar in course page in front-end to allow the user to see
        it's progression. When completed, the tag completed is displayed instead of
        the progressbar.
      
      - On slide page in front-end(normal view or fullscreen) when a course is
        completed, display the tag completed instead of the progressbar.
      
      - Removed completed state on course "Taking care of Trees" for portal user
        because it was not the case.
      
      task-2049689
      
      closes odoo/odoo#36608
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      42a24e41
  14. Oct 22, 2019
  15. Oct 11, 2019
  16. Oct 03, 2019
  17. Oct 02, 2019
    • Romain Derie's avatar
      [IMP] website, website_*: improve edit in backend feature · 9b38bcec
      Romain Derie authored
      *base, website_blog, website_event, website_forum, website_slides
      
      With this commit:
      1. It is now possible to add the 'Edit in backend' entry in the frontend navbar
         for any desired model, not only the ones which have the published mixin.
         It will simply redirect to the main_object form view.
         This commit add it to Forum and Blog.
      2. When clicking on 'Edit in backend', it is now possible to land on another
         module than Website.
         That's especially useful for events and slides which are not directly
         related to the website module as they have their own module.
      3. Remove the custom Edit in backend from the forum homepage (fa-cog).
         Opportunity was also taken to remove the 'edit welcome message'.
         It will now be editable through the editor (welcome message will appear in
         edit mode). Thus we got rid of the custom edit welcome message controller
         and views.
      
      Closes #36325
      9b38bcec
    • Stéphane Bidoul's avatar
      [IMP] mail: enforce kw args for message_{post/notify/log} · c8c8413e
      Stéphane Bidoul authored
      
      Since there are message_post overrides using the form `def message_post(self,
      **kwargs)` in some modules, this method is intended to be invoked with keyword
      arguments only.
      
      This commit enforces this behavior. Calls such as `message_post("body")` will
      fail regardless of which addon is installed, forcing users to use
      `message_post(body="body")`.
      
      It also fixes a message_post override in hr, and applies the same
      mechanism to message_notify, and _message_log.
      
      closes odoo/odoo#33306
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      c8c8413e
  18. Sep 20, 2019
  19. Sep 12, 2019
  20. Sep 13, 2019
    • Lucas Lefevre's avatar
      [FIX] website_slides: still another fix of computed fields · 290341b4
      Lucas Lefevre authored
      This commit fixes 2 issues coming from the recent ORM changes: records are
      new records in onchange and compute methods must assign a value for all records.
      
      In an onchange method, self.ids is a list of integer (real records)
      whereas self.id is a NewId (virtual record)
      
      Here a result dict was built using the reals ids as keys but later NewIds
      are used as keys. Solution is to use record._origin to access the real record.
      
      Moreover, the two dicts `result` and `type_stats` are the same. Assigning one
      into the other is useless.
      
      Task 2067872 (eLearning internal testing)
      PR #36756
      290341b4
    • Thibault Delavallée's avatar
      [FIX] website_slides: avoid admin being twice member of courses · 0eec4d22
      Thibault Delavallée authored
      Since admin is responsible of all created demo channels and then re-added
      manually as member in demo data of slide.channel.partner he is actually
      twice member of some channels. This commit fixes that by resetting its
      membership status before adding membership demo data.
      
      PR #36756
      0eec4d22
    • Thibault Delavallée's avatar
      [FIX] website_slides: make content stat button redirection match counters · 477b73ed
      Thibault Delavallée authored
      Course content counters count only published content while content stat button
      redirects to all contents. Solution to this mismatch is to apply a search
      filter on button action to display published ontent by default.
      
      Also remove unnecessary action. Using a type="edit" seems sufficient, no need
      to define a python method just for that purpose.
      
      Task 2067324 (counters / action on content mismatch)
      PR #36756
      477b73ed
  21. Sep 11, 2019
    • mcm-odoo's avatar
      [IMP] website_slides: improve slides backend views · 3e4b0f32
      mcm-odoo authored
      This commit improves a bit the existing backend views of the elearning
      app (notably propagating content and course labeling instead of slide and
      channel) and adds a pivot view for model slide.slide.
      
      FP feedback
      
      Task 2066646
      3e4b0f32
  22. Sep 03, 2019
    • Michaël Mattiello's avatar
      [IMP] website_slides_{*}: improve backend UI, views and user actions · 8c9473fd
      Michaël Mattiello authored
      Purpose of this commit is to perform a back2basics on eLearning backend
      views. It helps users in their daily use of eLearning and improve UI.
      
      Containing
      
        * channel kanban view tweaking;
        * channel form view: some spacing and renaming improvements. Also set
          advanced field (new content email, share template) as group no one;
      
        * slide kanban view tweaking;
        * removed sections from kanban and list view for contents;
        * contents form view: various improvements, with notably
      
          * removed field website_url;
          * set publishded date is now readonly, tracked and in group_no_one as
            it is automatically set when publishing the lesson, and people should
            not update it manually;
          * removed the sum "Content" and replaced it by a stat button
          * reword quiz constraint error messages;
      
        * rating views improvements:
          * revamped the kanban view of rating that were a bit broken;
          * added a pivot view in Reporting/Reviews;
          * updated graph view in Reporting/Reviews;
      
      This commit also provides some usability fixes
      
        * prevent sending email if new content is category;
        * email: Prevent displaying an image if there is no image;
      
      LINKS
      
      Task 2049640 (website slides back2basics and fiximp)
      Task 2058595 (eLearning v13 testing)
      8c9473fd
    • laa's avatar
      [FIX] website_slides: correctly set sequence of newly added content · c4eba6f5
      laa authored
      
      Purpose of this commit is to add new content at last position in frontend.
      Indeed backend uses last position in embedded list view, frontend should
      do the same. Moreover when having a lot of content, having everything at
      the bottom of the screen at the same position of Add content / section
      buttons makes sens.
      
      Specifications
      
        * when adding a new category: add it as last category;
        * when adding a new slide in a category: add it as last slide of the
          category;
      
      Specific case of slide without category
      
        * when adding a new slide without category: add it as last slide of the
          channel (display it as last) but keep it on top in backend view
          (display as first);
      
      Improve content list display in frontend of eLearning
      
        * contents without section are now at the bottom;
        * fixed alignment of buttons icon (Add Content and Add Section)
        * fixed broken design because of title too long
      
      Task 2049640 (website slides back2basics and fiximp)
      Task 2061672 (new content bug report)
      
      Co-Authored-By: default avatarMichaël Mattiello <mcm@odoo.com>
      Co-Authored-By: default avatarAlexis Lacroix <laa@odoo.com>
      c4eba6f5
  23. Aug 30, 2019
  24. Aug 28, 2019
    • Thibault Delavallée's avatar
      [FIX] website_slides{_*}: fix completion computation, notably with certifications · f9306460
      Thibault Delavallée authored
      PURPOSE
      
      Test frontend and UI tools of eLearning.
      
      SPECIFICATIONS
      
      Since 9920f20e course completion when finishing a certification survey
      is broken. Indeed channel completion is not correctly recomputed. A
      certification course can therefore never be completed and awarded. This
      commit fixes that and correctly update channel completion based on survey.
      
      In this commit we also rename some methods
      
        * _compute_completion: renamed to _recompute_completion to avoid naming issue
          with computed field convention;
        * _post_completion_hook is not unnecessary as code in hr_skill can be done
          after calling super of _recompute_completion;
        * _completed_callback is renamed to _set_completed_callback to be coherent
          with slides naming;
      
      LINKS
      
      Task ID 1937768
      f9306460
  25. Aug 22, 2019
  26. Aug 20, 2019
    • Sébastien Theys's avatar
      [IMP] website, website_slides: adapt get_base_url for website · 1e8b9254
      Sébastien Theys authored
      
      On `website` itself there is no `website_id` so the domain has to be read from
      `self` directly.
      
      Also oversight of forward-port 039e6bae:
      On `slide.channel` the override that was done in an earlier version is doing the
      same as the generic override that was introduced later, so it can be removed.
      
      closes odoo/odoo#35839
      
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      1e8b9254
    • Raphael Collet's avatar
      [IMP] models: ORM speedup · 9920f20e
      Raphael Collet authored
      
      This branch is the combination of several optimizations in the ORM:
      
      * store field values once in the cache: the cache reflects more
      faithfully the database, only fields that explicitly depend on the
      context have an extra indirection in the cache;
      
      * delay recomputations by default: use method `recompute` to explicitly
      flush out pending recomputations;
      
      * delay updates in method `write`: updates are stored in a data
      structure that can be flushed efficiently to the database with method
      `flush` (which also flush out recomputations);
      
      * make method `modified` take advantage of inverse fields to inverse
      dependencies;
      
      * filter records by evaluating a domain on records in Python;
      
      * a computed field with `readonly=False` behaves like a normal field
      with an onchange method;
      
      * computed fields are computed in superuser mode by default.
      
      Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
      Pinckaers.
      
      closes odoo/odoo#35659
      
      Signed-off-by: default avatarDenis Ledoux <beledouxdenis@users.noreply.github.com>
      9920f20e
Loading