Skip to content
Snippets Groups Projects
  1. Mar 18, 2019
  2. Mar 14, 2019
    • Arnold Moyaux's avatar
      [FIX] stock: redundant move line on _set_quantity_done · 7e96d485
      Arnold Moyaux authored
      
      Usecase to repdoduce:
      BOM 1 final product F - 2 components C
      - Create a MO of 2 units F
      - Do not reserve
      - Produce 1 units twice
      
      You have 1 finished line with 0 quantity and another with 2 quantity.
      
      It happens because _set_quantity_done expect reservation on
      move line. It checks the reservation - quantity done on a move line
      as quantity to add. Since you have no reservation in will result as
      - quantity done and it will remove the quantity done on existing line.
      Then it removes the quantity done added on move line on the total
      quantity to add passed as an argument. It results as
      qty_to_consume -(-move line quanity done). At the end of the method it
      creates a new move line with the remaining quantity to consume (on which
      was added the quantity done of not reserved move line).
      
      Skip the move line update if the quantity reserved - quantity done is
      negative.
      
      closes odoo/odoo#31805
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      7e96d485
    • Arnold Moyaux's avatar
      [FIX] mrp: produce too much · 20c6a65c
      Arnold Moyaux authored
      Usecase:
      - Produce 1 product not tracked
      - Produce 1 product not tracked
      The total number of finished product is 3
      
      It happens because _set_quantity_done will
      add the quantity and not set it to the quantity
      passed as argument. In produce wizard it pass
      as argument the quantity of move line + the produced
      quantity. It will result as twice the quantity of the
      move line + the quantity producing
      20c6a65c
    • Arnold Moyaux's avatar
      [FIX] mrp: produce wizard negative reserved qty · c2f6e598
      Arnold Moyaux authored
      Usecase to reproduce:
      BOM 1 product final F -> 2 components C
      - 1 units of C in stock
      - MO of 2 units of F
      - Reserve MO
      - Produce wizard 2 units of F -> C 4 to consume 1 reserved
      - Update quantity to 1
      
      -> The produce line for C contains -1 reserved
      
      It happens because the system remove the quantity to consume on
      the reservation. However sometimes the quantity reserved is lower
      than the quantity to consume and it will result in a negative quantity
      reserved.
      c2f6e598
    • Arnold Moyaux's avatar
      [FIX] mrp: remove unreserved line first · 4ed25f56
      Arnold Moyaux authored
      Since the quantity producing could change on the produce
      wizard. The first quantity to remove is the quantity not
      reserved on the MO.
      4ed25f56
    • Arnold Moyaux's avatar
      [FIX] mrp: wrong reserved quantity in produce wizard · ce355c97
      Arnold Moyaux authored
      Issue 1:
      Usecase to reproduce:
      BOM: 1 prod final F -> 2 unit of components C
      - Create a MO of 2 units
      - Reserve 4 units of C
      - Produce 1 unit of F (produce wizard)
      - Save
      - Produce 1 unit of F
      - Update quantity to 2
      The reserved quantity in the wizard is 4 although there is 2 units
      already done on the first operation. So it should remain 2.
      
      It happens because the produce wizard did not take into account the
      2 units already done on the first stock move line.
      
      This commit fix by using ml.product_qty - ml.qty_done each time it's
      needed.
      
      Issue 2:
      Usecase to reproduce:
      SAME BOM
      - Create a MO of 2 units
      - Reserve
      - update quantity to 3
      - It creates a new line with to consume 2, reserved 0
      - update quantity to 4
      - It update the line 2 0 to  4 to consume 4 reserved
      So we ended with 8 units of C reserved.
      
      It happens because the system match the workorder line with the stock
      move line one by one without a global view on what is reserved or not.
      So the second workorder line found a move line with 4 reserved but 0
      done and did not check the first workorder line that already use the
      4 pieces reserved. So it considers it as available and take the
      reservation a second time.
      
      It's fixed by an iteration over workorder line instead of move line
      and keep the used reserved quantity in a dict by lot.
      
      Issue 3:
      Usecase to reproduce:
      SAME BOM
      - Create a MO of 2
      - Produce 2
      - Update quantity to 3
      New line with to consume 2 reserved 0
      - Update quantity to 4
      New line with to consume 2 reserved 0
      It's bad since we would like a line 4 0 as in saas-12.1
      
      It happens because _update_workorder_lines will always create a new
      line with remaining quantity if it could'nt find one with reservation
      to update. However the line could exist without reservation so it
      should update it instead of creating a new one.
      
      It's fixed by adding the remaining quantity in the first workorder line
      without lot (if the tracking is serial it should continue to create a
      new line).
      ce355c97
    • Arnold Moyaux's avatar
      [FIX] mrp: create extra move with the quant location · b0a68530
      Arnold Moyaux authored
      When the user consumed more raw materials than reserved. The system
      was supposed to take the extra quantities from existing stock and so
      their location. However the reserved quantity is always lower or equals
      than the quant quantity. reserved - quantity is always negative or equal
      0 and the float compare after will always return true and the code will
      never be executed and will return the move location.
      b0a68530
  3. Mar 15, 2019
    • qmo-odoo's avatar
      [FIX] website_slides_survey: go to survey if only one slide certification · add45ee4
      qmo-odoo authored
      
      Purpose of this commit:
        In case there is only one slide in the course and that unique slide
        is of type certification, clicking on the link redirects the user
        to the survey page instead of the fullscreen view
      
      Task-1946511
      
      closes odoo/odoo#31843
      
      Signed-off-by: default avatarJérome Maes (jem) <jem@openerp.com>
      add45ee4
    • qmo-odoo's avatar
      [FIX] website_slides_survey: certification slide url · e8e8d7a9
      qmo-odoo authored
      Before this commit, in fullscreen mode, clicking on the "pass certification"
      button would redirect the user to the "non-fullscreen" view.
      After this commit, the button directly redirects the user to the survey page.
      
      To avoid generating user_input of survey (test entry or not) for
      certification slides in fullscreen mode (table of content), we decided
      to create those user_input lazily: we redirect the user to a route that
      create (or reuse) the correct user_input.
      
      Task-1946511
      e8e8d7a9
    • Aurélien Warnon's avatar
      [IMP] survey: add a download button at the end of certification process · 44ae98d3
      Aurélien Warnon authored
      Purpose
      =======
      
      When the user successfully takes a certification, he can download the certification
      document using a new "Download certification" button.
      (In addition to receiving an email containing the certification)
      
      Also cleaned a bit the way certifications are downloaded.
      
      Task-1941250
      44ae98d3
    • Jérome Maes's avatar
      [FIX] website_slides: avoid putting unexisting attribute on object · 34f72667
      Jérome Maes authored
      In this computed field, an attribute is assigned to the record
      but this attribute does not exist. Python authorized this but
      this makes the code ugly and this is definitely not a good
      practice.
      
      Task-1941250
      34f72667
    • Jérome Maes's avatar
      [FIX] website_slides: prevent to mark a certification as done · 954e8ca6
      Jérome Maes authored
      When a certification slide is display in no fullscreen
      mode, the done button is clickable. Same applies to quiz
      slide.
      This commit prevents user to manually mark a slide as done
      for slide type that requires an other action (submit answer,
      pass survey, ...).
      
      Task-1941250
      954e8ca6
    • Jérome Maes's avatar
      [FIX] website_slides: auto set done successfull quizz · 32c5632a
      Jérome Maes authored
      For now, in no fullscreen mode, if the quiz is succeed, the
      user progress is not updated because the quiz is not set
      to done.
      This commit implements this call to mark slide as done and
      green the check bullet.
      We decided to unify the submit RPC call with the done one,
      so a quiz (or a slide with questions) can only be done when
      submitting answers. As consequence, we need to prevent some
      slide type to use the /set_completed route (quiz and certif).
      
      Task-1941250
      32c5632a
    • Aurélien Warnon's avatar
      [FIX] website_slides: avoid access error when submitting quiz · 55f61d95
      Aurélien Warnon authored
      Purpose
      =======
      
      The quiz_submit method and the action to set the quiz done both use
      the slide_partner relation that has to be accessed in sudo mode.
      
      Task-1941250
      55f61d95
    • sri-odoo's avatar
      [IMP] website_slides: embedded player restyling · 54261c4e
      sri-odoo authored
      The style and DOM structure of the embeded player (used
      to display PDF file) is old, and it needed a little refresh
      to be adapt to bootstrap4 and modern styling.
      
      Task-1941250
      54261c4e
    • sri-odoo's avatar
      [FIX] website_slides: styling fullscreen mode · 69fb136a
      sri-odoo authored
      Since the fullscreen widget has been revamped, it needed
      to be pixel perfect. This commit cleans the CSS and DOM
      structure in order to optimize and sublime it.
      
      Task-1941250
      69fb136a
    • Robot Odoo's avatar
      [MERGE][IMP] website_slides, website_*: email validation, comment restrictions... · 77fa2d69
      Robot Odoo authored
      [MERGE][IMP] website_slides, website_*: email validation, comment restrictions with karma and search user profile
      
      This merge is improving various points linked to eLearning.
      Impacted modules: website_profile, website_forum, website_rating and website_slides
      
      - Move validation email from website_forum to website_profile to use the feature in both Forum and elearning. The purpose is to give first karma points to allow users to comment, vote, ... on slides.
      - Add search bar in 'all users' page. To do so, we needed to introduced the `karma_position` field.
      - Restrict comment, review and vote based on user's karma in eLearning (minimum karam required to review/vote/comment, like in forum). This feature required to add 3 stored fields, with the benediction of chs !
      - Fix channel completion computation and linked karma gain. Also provide some test on karma gain.
      
      See sub commits for more details.
      
      Task-1943788
      
      closes odoo/odoo#31321
      
      Signed-off-by: default avatarJérome Maes (jem) <jem@openerp.com>
      77fa2d69
    • David Beguin's avatar
      [IMP] website_slides : improve get slide access computation · 5798ca28
      David Beguin authored
      As slides are returned in sudo to the template, the user rights were
      checked via a can_access variable set in the template directly.
      In order to disable the vote for user that cannot get access to the course
      all the checks are now done in backend (also to avoid to get access to slides
      in sudo mode with rpc calls). We add now, for each slide on the course view,
      the access and vote rights to the template : can_access and can_vote.
      Those two are computed in backend, using the user's access right instead of admin's.
      But, as if the user is not member of the channel, he cannot get access to the
      course slides (expect for Free Peview ones), so the check on can_vote
      will crash. This is why we check the access rights before checking can_vote,
      for each slides (as free preview slides are still accessible,
      even if the user is not in channel members).
      
      The vote widget is disabled if user's can_access or can_vote = False, enabled otherwise.
      If user have access but have not enough karma, the controller will handle this
      case and return an error to the user telling him he has not enough karma to vote.
      If user can vote but cannot access, the controller will handle this
      case and return an error to the user telling him he has no access to the lesson.
      
      Task ID: 1943788
      PR #31321
      5798ca28
    • David Beguin's avatar
      [IMP] website_slides : allow review, comment and vote only if enough karma · d4db21a9
      David Beguin authored
      To avoid eLearning to be spammed, the comment, review and vote behaviours
      are now allowed only if the user has enough karma to do it.
      
      Here is the new behaviour on courses and slides rating / comment / vote
          -If allow_comment is checked on Course :
              - Review (rating) is allowed on Course only if enough karma
              - Comment is allowed on slides within the course
                  only if enough karma and course type is 'training'
              - Vote is allowed on slides within the course
                  only if enough karma and course type is 'documentation'
          -If allow_comment is not checked on Course :
              - Review (rating) is not allowed on Course
              - Comment is not allowed on slides within the course
              - Vote is not allowed on slides within the course
          - Rating is not allowed on slides within the course anymore
      
      Task ID : 1943788
      PR #31321
      d4db21a9
    • David Beguin's avatar
      [FIX] website_slides : fix and add tests on karma gain · 81cebf34
      David Beguin authored
      Fix karma channel completion computing and karma gain :
          set to complete only if not completed
          and handle eventual multi course completion
      Removes unused karma gain rules.
      Add karma unvote rule to loose the karma gained if user changes his mind.
      Test karma gain on each users.
          Note : technically, public user could be member of a course,
          but functionally speaking, this case should and could never happen
          (it's a non sens anyway)
          -> public user has not been tested for this reason.
      
      Task ID : 1943788
      Closes PR #31321
      81cebf34
    • David Beguin's avatar
      [IMP] website_profile, gamification, : add search bar in all users page · d7cc1520
      David Beguin authored
      This commit adds the search bar in 'All users' page in order to filter on name or company name.
      To be able to keep the position, a non stored computed field has been added on res_users
      to get the position depending on the user's karma.
      
      The podium (top 3 users) is now displayed only if there is no search applied and if the page = 1
      because it has no sens anymore in other cases.
      
      Special thanks to @jem-odoo who helped me finding smart solution for position computing.
      
      Task ID : 1943788
      PR #31321
      d7cc1520
    • David Beguin's avatar
      [IMP] website(_profile,_forum,_slides): move validation email to profile and... · fb40c6bf
      David Beguin authored
      [IMP] website(_profile,_forum,_slides): move validation email to profile and use in forum and elearning
      
      Email validation was necessary on the forum to be able to begin to use the forum
      (ask or answer questions, vote, etc..)
      
      As the new elearning also uses karma since 705376a9,
      the email validation is now also necessary in the eLearning platform.
      
      This is why this commit is moving the email validation process to website_profile
      and extend website_slides (eLearning) and website_forum to use this feature.
      
      In function of where the user asked to send him the validation email,
      the user is redirected on the forum or on the elearning when he clicks on
      'Validate my account' in the received 'email validation' email.
      
      Task ID : 1943788
      PR #31321
      fb40c6bf
  4. Mar 14, 2019
  5. Mar 13, 2019
Loading