Skip to content
Snippets Groups Projects
  1. Aug 09, 2021
  2. Aug 08, 2021
  3. Aug 06, 2021
  4. Jul 21, 2021
  5. Aug 03, 2021
  6. Aug 01, 2021
  7. Jul 29, 2021
    • Nathan Marotte (nama)'s avatar
      [FIX] stock: Wrong rounding on returning a delivery with different UoM · f609b16f
      Nathan Marotte (nama) authored
      
      Issue: When making a return for a transfer, the precision_rounding was taken from the UoM of the product given in the transfer, but the quantity was taken in the UoM of the product defined on its form
      
      Steps to reproduce :
       1) Create a UoM "Hundreds", rounding precision 1 (has to be different than "Dozen"), Bigger than the reference Unit of Measure, ratio 100
       2) Create a test product with "Dozen" as UoM
       3) Inventory > Operations > Transfers > Create
       4) Add test product, Demand=2, Unit of Measure=Hundreds
       5) Validate
       6) Create a Return for that transfer
       7) Quantity is set to 17 Dozen instead of 16.67
      
       Why is that a bug:
       The quantity to return is `quantity = stock_move.product_qty` (in UoM of the product form) but the rounding is made with rounding precision `stock_move.product_uom.rounding` (in UoM of the line of the transfer) which can be different in case of manual transfer creation for example
      
      opw-2543304
      
      closes odoo/odoo#74435
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      f609b16f
    • Sylvain LE GAL's avatar
      [FIX] stock: display menu action "Moves" · d8604bb1
      Sylvain LE GAL authored
      
      closes odoo/odoo#72646
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      d8604bb1
  8. Jul 28, 2021
    • Nasreddin Boulif (bon)'s avatar
      [FIX] mail: clean context on attachments creation · 45bd961c
      Nasreddin Boulif (bon) authored
      
      Manual backport of odoo/odoo@4504c9d8069082c9542226fbafdbf309089cf7a9 done in 13
      
      Steps to reproduce :
      
        - Install `CRM` and `Sales` modules
        - Go to Settings, activate "External Email Servers" and
          set an alias.
        - Edit 'Sales Team Europe' : add an alias
          (ensure alias end with the "External Email Servers" alias)
        - Send a mail to the europe sale team alias email with a
          base64 image in the html body
          ex: <img alt="" src="data:image/png;base64,ABCDE123....789">
      
      Issue :
      
        - Traceback is raised.
        ("ValueError: Wrong value for ir.attachment.type: 'opportunity'.")
      
      Cause :
      
        Both `crm.lead` and `ir.attachment` have a `type` field.
      
        When creating the thread, in this case of crm.lead model,
        it will add the 'default_type' and 'default_team_id' to the
        context.
      
        The context will be inhrited and used on the creation of the
        ir.attachment (in this case its the base64 encoded image
        inside the body).
      
        Since no `type` was provided while creating the ir.attachment,
        it will set the type from `default_type` in context since
        available.
      
      Solution :
      
      - Clean the context (in this case, it will remove `default_X` values)
        when creating the ir.attachment .
      
      opw-2551461
      
      closes odoo/odoo#74374
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      45bd961c
    • Jairo Llopis's avatar
      [IMP] test_mail: test models with type do not mess with attachment types · a7574396
      Jairo Llopis authored
      Purpose of this commit is to highlight an issue that may happens easily with
      `crm` that is made generic here within `test_mail`.
      
      `crm` alters the context when creating a new record adding in this case
      `default_type` to it][1]. The returned record contains that altered context.
      his results in other records created from it trying to assign that same default
      value for `type`. This is a very common name for fields, and happens to exist
      in `ir.attachment` too.
      
      If you create an alias for incoming leads in your DB with default values
      `{"type": "lead"}` (something very common) and then an email comes to that
      alias that contains an inlined base64 image, the attachment creation process
      would simply fail.
      
      Obtained error is ``ValueError: Wrong value for ir.attachment.type: 'lead'`` .
      
      [1]: https://github.com/odoo/odoo/blob/272602193f5647f7f2270ed6ec68777625a139dd/addons/crm/models/crm_lead.py#L310-L311
      
      
      
      Co-Authored-By: default avatarThibault Delavallee <tde@odoo.com>
      a7574396
  9. Jul 23, 2021
  10. Jul 26, 2021
    • Arnold Moyaux's avatar
      [FIX] stock: prevent to copy reservation on stock.move.line · 0c293ce4
      Arnold Moyaux authored
      
      Usecase:
      - Product A 10 units in stock
      - Do a planned transfer of 7 units to customer
      - Reserve
      - Do an rpc or execute code to call copy on the stock.move.line
      
      It will result with 2 sml that have 14 units reserve and 7 units
      reserved on stock.quant
      
      It's the same result if you create twice the stock.move.line without
      updating the stock.quant at the same time. However in stable we
      try to only use _update_reserved_quantity on stock.move or some
      override in create/write method for 'done' stock.move.line in unlock
      cases.
      
      So we never use the copy in stable and define the basic behavior as
      'we don't copy the reservation' could prevent some usecase where
      the update on the stock.quant is forgotten after.
      
      closes odoo/odoo#73870
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      0c293ce4
    • Gorash's avatar
      [FIX] web: avoid a scrollbar when a carousel is added in pages · 904a0434
      Gorash authored
      
      On Chrome, the browser displayed an horizontal scrollbar because the
      sr-only item inside the 'next' arrow was positioned absolutely, outside
      of the arrow, and thus outside of the window. This happened for the
      website carousel snippet when added in pages for instance.
      
      opw-2585526
      
      closes odoo/odoo#73641
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      904a0434
  11. Jul 15, 2021
  12. Jul 25, 2021
  13. Jul 23, 2021
  14. Jul 22, 2021
    • Xavier-Do's avatar
      [REM] codeowner: remove github codeowner · 5d40023e
      Xavier-Do authored
      
      Github codeowner is replaced with a runbot version of codeowners for
      multiple reason:
      
      - github codeowners is difficult to maintain, the precedence rule will
      sometimes remove teams from some file because of a more specific rule
      added by another team.
      
      - github codeowner does not support version specific rules, especially
      the "all except master" rule. For this use case teams needs to adapt
      the new codeowner when freezing a new version.
      
      - github will trigger codeowner on failed rebase, and add almost all
      teams as reviewer. Runbot has specific commit and file limit to avoid
      this problem.
      
      - runbot codeowner is centralised and does not need to be managed cross
      repo/version
      
      - runbot codeowner works for enterprise
      
      Any mofification on codeowner should be requested to runbot team.
      
      closes odoo/odoo#74094
      
      Signed-off-by: default avatarXavier Dollé (xdo) <xdo@odoo.com>
      5d40023e
  15. Jul 01, 2021
  16. Jul 11, 2021
  17. Jul 20, 2021
  18. Jul 18, 2021
  19. Jul 16, 2021
  20. Jun 28, 2021
    • Kamen Zhekov's avatar
      [FIX] account: Fix traceback when creating journal item from analytic account · 8761f7b6
      Kamen Zhekov authored
      
      Description of the issue/feature this PR addresses:
      When trying to create a journal item from a new entry in analytic accounts -> cost & revenues, a traceback was issued because there is no account.move linked to it.
      
      Desired behavior after PR is merged:
      The user is no longer able to create Journal Items from the form view in Analytic Accounts -> Cost & Revenues.
      
      OPW: 2517311
      
      --
      I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
      
      closes odoo/odoo#72846
      
      Signed-off-by: default avatarQuentin De Paoli (qdp) <qdp@openerp.com>
      8761f7b6
  21. Jun 21, 2021
    • alt-odoo's avatar
      [FIX] fleet: prevent deletion of vehicle contract · edc8368f
      alt-odoo authored
      
      When we create a contract information on a vehicle, there is an activation cost
      automatically created. Before this fix, if we delete the activation cost line, it
      deletes automatically the associated contract. We should prevent this and add a
      warning message instead.
      
      To make it easier for the user, we should also show the contract information on
      the list and form views of the vehicule cost.
      
      When deleting the vehicle contract, we should also automatically delete the
      activation cost line associated.
      
      closes odoo/odoo#72269
      
      Signed-off-by: default avatarAlex Tuyls <alt-odoo@users.noreply.github.com>
      edc8368f
  22. Jun 17, 2021
  23. Jun 24, 2021
    • William Braeckman's avatar
      [FIX] hr_recruitment: fix calendar_events · f23e07dc
      William Braeckman authored
      
      When using the Add button on the calendar view introduced with
      odoo/odoo#64948 the event would not be linked with the applicant.
      
      After further investigation the method used to get the applicant id in
      default_get was not flexible enough, the one from crm calendar has been
      'copied'
      
      Task ID: 2578165
      
      closes odoo/odoo#72731
      
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      f23e07dc
  24. Jul 01, 2021
    • Nicolas Lempereur's avatar
      [FIX] hr_holidays: request date tz whole company · de629275
      Nicolas Lempereur authored
      
      When setting the request_date_from and request_date_to when creating a
      leave that will be used to show the range of days of the leaves, we are
      using the current user timezone to determine it.
      
      eg. in UTC+2 if the leave begins at midnight on the 6th, we will see 6
      and not 5 which is the day in UTC.
      
      When creating a leave in a mode different than employee, when it is
      confirmed and a leave is created for each employee, we would use the UTC
      day instead which is a little unexpected.
      
      Without the fix, the added test fails with:
      
          AssertionError: datetime.date(2019, 5, 5) !=
          datetime.date(2019, 5, 6) : Timezone should be kept between company
          and employee leave
      
      opw-2573730
      
      closes odoo/odoo#73073
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      de629275
  25. Jul 09, 2021
  26. Jul 11, 2021
  27. Jul 09, 2021
  28. Jul 08, 2021
    • Ivan Yelizariev's avatar
      [FIX] mail: speed up read_progress_bar · d17c20e2
      Ivan Yelizariev authored
      
      This commit fixes the performance issue in getting statistics for
      ``activity_state`` (colored clock icon for overdue/today/planned) in
      CRM.  The query has been tested for several years on a large database
      (Odoo's own production database).
      
      Performance test on 29 K crm.lead records (activity_state):
      
      With a filter for 10 records:
      
      ```
      | measurement        | before | after |
      |--------------------+--------+-------|
      | number of queries  |     25 |     5 |
      | query time, ms     |     12 |    95 | (*)
      | remaining time, ms |     32 |     7 |
      ```
      
      All records:
      
      ```
      | measurement        | before | after |
      |--------------------+--------+-------|
      | number of queries  |   1326 |     5 |
      | query time, ms     |   1739 |   129 |
      | remaining time, ms |  47934 |    17 |
      ```
      
      As we can see in the last results, the time went from almost 50 seconds
      (not responsive at all) to 150 milliseconds (responsive).  The time
      increase in (*) may be caused by imperfect measurements, which are raw
      and not averaged measures.
      
      ---
      
      opw-2346901
      task-1915411
      
      closes odoo/odoo#67004
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      Co-authored-by: default avatarNicolas Seinlet <nse@odoo.com>
      d17c20e2
    • Ivan Yelizariev's avatar
      [FIX] web: speed up read_progress_bar · e54d87b7
      Ivan Yelizariev authored
      
      The method is used to get progress per column in kanban view
      (green-yellow-red-red lines in Project, CRM etc).  There are two main
      usages:
      
      1. get statistics for ``kanban_state`` (red/green circles)
      2. get statistics for ``activity_state`` (colored clock icon for overdue/today/planned)
      
      Before this commit all cases were handled by calling search_read and then
      counting records per group in a python script.  This is very inefficient,
      especially for ``activity_state``.
      
      This new implementation relies on ``read_group`` when possible, i.e.,
      when both grouping fields (kanban column and progressbar field) are
      stored (case 1).  It then falls back on a naive implementation inside
      ``_read_progress_bar``.  Cases like 2 above can be addressed by
      overriding ``_read_progress_bar``.
      
      We also added some minimal test to ensure that we don't break anything.
      
      1. Performance test on 60 K project.task records (kanban_state):
      
      With a filter for 6 records:
      
      ```
      | measurement        | before | after |
      |--------------------+--------+-------|
      | number of queries  |      8 |     5 |
      | query time, ms     |     11 |     7 |
      | remaining time, ms |     21 |     9 |
      ```
      
      All records:
      ```
      | measurement        | before | after |
      |--------------------+--------+-------|
      | number of queries  |     67 |     5 |
      | query time, ms     |    300 |    55 |
      | remaining time, ms |   1780 |    12 |
      ```
      
      Co-authored-by: default avatarRaphael Collet <rco@odoo.com>
      
      ---
      
      opw-2346901
      task-1915411
      e54d87b7
  29. Jul 06, 2021
    • Adrien Widart's avatar
      [FIX] sale_stock: set invoice_status value when delivery is canceled · 9bedda18
      Adrien Widart authored
      
      Suppose the option "Lock Confirmed Sales" enabled and a product with the
      invoicing policy set to "Delivered quantities". When cancelling the
      delivery of such a product, the invoice status of the associated SO
      should be 'Nothing to Invoice'
      
      To reproduce the error:
      1. In Settings, enable "Lock Confirmed Sales"
      2. Create a product P:
          - Type: Consumable
          - Invoicing policy: Delivered quantities
      3. Create a SO with one P
      4. Confirm the SO
      5. Cancel the SO's delivery
      6. Check the invoice status (`invoice_status`)
          - 12.0: Either by modifying the view, or by adding the field with
      studio or directly via PSQL
          - 13.0+: The field can be enabled thanks to the options of the tree
      view
      
      Error: The invoice status is "Fully Invoiced" but the product hasn't be
      delivered and no invoice has been created
      
      OPW-2464343
      
      closes odoo/odoo#73310
      
      Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
      9bedda18
Loading