Skip to content
Snippets Groups Projects
  1. May 06, 2021
  2. May 05, 2021
  3. May 06, 2021
  4. Oct 07, 2020
  5. May 06, 2021
    • abd-msyukyu-odoo's avatar
      [FIX] web: fix kanban view progressbars related to records in another group (groupby:week) · 665e9538
      abd-msyukyu-odoo authored
      * IMPACTED VERSIONS
      
        12.0+
      
      * HOW TO REPRODUCE
      
      locale :  Locale is en_US (or other SUNDAY based)
      view:     CRM - My Pipeline - Kanban view
      groupBy:  date_deadline:week (Expected closing)
      records:  one record with a planned activity, on date_deadline = 2021-05-02 (SUNDAY)
                one record with no planned activity, on date_deadline = 2021-05-09 (SUNDAY)
      remark:   don't keep any other record in MAY for better visibility
      
      * PROBLEM
      
      The progressbar of the week containing 2021-05-09 displays information about the record
      from the week containing 2021-05-02
      
      * CAUSE
      
      1. PostgreSQL `date_trunc` function follows ISO8601 which essentially means that
        the start of a WEEK is always MONDAY. There is no argument to change this.
      
      2. _read_group_format_result
        https://github.com/odoo/odoo/blob/27da86a138089c1838e4b94f8a6976995b9c1fff/odoo/models.py#L2210-L2219
      
        - Computes a label for a group of records.
        - Follows the locale for the label of the week, based on a date which is
          always a MONDAY because of `date_trunc`.
      
      3. read_progress_bar
        https://github.com/odoo/odoo/blob/88957afca09662af7eaa19df1e40b3699e45e79e/addons/web/models/models.py#L167-L175
      
      
      
        - Associates a group label to a record.
        - Follows the locale for the label of the week, based on the date of a record
          which can be any day of the week. If the record is related to a SUNDAY and
          SUNDAY is the first day of the week, it would have been in a group with a
          different label in (2.) than in (3.) prior to this change.
      
      * FIX
      
      In 3., before associating a label to a record, we truncate the date to the
      ISO start of the period, so that the label is determined for a record in the
      same conditions than in 2. The locale is still used to get language-dependent
      outputs with babel, but the grouping will always follows ISO8601 (date_trunc).
      
      * TEST
      
      Added a test for this problem case
      
      TASK-ID : 2517848
      
      closes odoo/odoo#70453
      
      X-original-commit: c08f6e3e
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      665e9538
  6. May 05, 2021
    • Rémy Voet (ryv)'s avatar
      [FIX] stock: fix broken forecasted report template · e0bafb07
      Rémy Voet (ryv) authored
      
      Remove the optimization of the `product_tmpl_id` related fields which
      needs a upgrade to work without any issues.
      
      This reverts partially the commit
      4c627651.
      
      Find a other for the stable to optimise the forecasted report of product
      template:
      When the `product_tmpl_id` is in the domain of a read_group, it will
      be replace by a equivalent clause with `product_id` instead to avoid
      any sub-query which didn't help the postgreSQL planner.
      The performance decrease but it still acceptable compared that before
      the revert fix (test with one template with 256 variants in
      a DB with 40K products and 100K moves, 1K locations, etc)
      - Revert fix (which need a upgrade): 75 ms
      - new fix (no need a upgrade): 130 ms
      - without any fixes (before the revert fix): 500 ms (also have a bigger
      scale penalty)
      
      closes odoo/odoo#70381
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      e0bafb07
  7. May 06, 2021
  8. May 05, 2021
  9. May 04, 2021
  10. May 03, 2021
    • oco-odoo's avatar
      [FIX] account: reconciliation models: fix priorities when matching amls from payments · b5800c9d
      oco-odoo authored
      
      Since the payment refactoring, the structured reference of a payment is stored in its ref field, not payment_reference like for invoices. This caused payments never to be matched with highest priorities, as payment_reference_flag was always false, and only communication_flag could match.
      
      To reproduce:
      
      - Have a reconcile model with match_total_amount=False.
      - Create a statement line with communication a1b2c3 for 1000
      - Create 3 payments:
      > 500, with memo a1b2c3
      > 500, with memo a1b2c3 (so, the same one)
      > 500, with memo d1e2f3
      - Open the reconciliation widget for your statement line
      
      ===> The 3 payments are matched, while only the two first ones should have been, as they were exact matches for the communication, and should hence have received higher priority.
      
      closes odoo/odoo#70277
      
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      b5800c9d
  11. Apr 29, 2021
    • Laurent Stukkens (LTU)'s avatar
      [FIX] sale_timesheet: prevent multicompany issue on SOL · 2480e959
      Laurent Stukkens (LTU) authored
      
      Steps to reproduce:
      
              - Create an SO for a prepaid service in company A and confirm it
              - Create a project and a task in company B and select the customer linked to the SO you previously created
              - Unselect company A from the multi-company widget; only display the records from company B
              - Timesheet on the task you previously created
      
      Observed behavior:
      
              - The SOL set by default belongs to company A, thus generating an access right error when trying to timesheet on the task
      
      Expected behavior:
      
              - The SOL set by default should belong to the same company as the task
      
      task-2515259
      
      closes odoo/odoo#69783
      
      Related: odoo/enterprise#17921
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      2480e959
  12. May 04, 2021
  13. Apr 28, 2021
  14. May 04, 2021
  15. Apr 27, 2021
  16. May 03, 2021
  17. May 04, 2021
  18. May 03, 2021
  19. Apr 19, 2021
  20. May 02, 2021
    • Swapnesh Shah's avatar
      [FIX] mrp: set default product on unbuild order · 4de0ae43
      Swapnesh Shah authored
      
      Before this commit, Creating Unbuild order using
       Unbuild Button was resetting Bom as it was calling
      `_onchange_product_id` after setting `mo_id` which was
      resetting Bom on Unbuild order.
      
      To Fix Issue, We setting `default_product_id` so It would not
      reset `bom_id` when `_onchange_product_id` is called.
      
      Fixes: #70216
      Odoo Ticket: 2521788
      
      closes odoo/odoo#70218
      
      Signed-off-by: default avatarRémy Voet <ryv-odoo@users.noreply.github.com>
      4de0ae43
  21. May 03, 2021
    • Romain Derie's avatar
      [FIX] http_routing, website: prevent crash when using `fw` in url · 0490828d
      Romain Derie authored
      
      Before this commit, the routing map generated and used would be the one from
      the website the request is performed, instead of the one from the `fw` website
      ID which will be the one we redirect the user to.
      
      This issue was introduced with the routing map by website, be8fc229 and is
      restricted to a single case: a publisher using the website switcher, and it
      won't happen on next page naviguation/refresh as the `fw` website id will be
      the same as the current website's ID. Thus there won't be any routing map
      mismatch.
      
      Step to reproduce:
        - Create a page on website 2, set it as homepage
        - Naviguate to website 1 on '/' url
        - Naviguate to website 2 on '/' url
      This will raise a werkzeug error about `EndPoint not iterable`.
      
      ----- Technical analysis ------
      
      This is the current flow:
      1. `_dispatch()` is setting `website_routing` to `get_current_website()` -> 2
      2. `_dispatch()` is calling `_match()`
      3. `_match()` is calling `routing_map()` with key = `website_routing`, which
         was set to 2 in step 1.
      4. `routing_map()` is calling `_generate_routing_rules()` which generate the
         rules based on `website_routing`, which was set to 2 in step 1.
      5. `_dispatch()` authenticate the user by calling `_authenticate()`
      6. `_dispatch()` is calling `_add_dispatch_parameter()`, where URL param `fw`
         is forced in session, so `get_current_website()` now return the correct
         `website_id` -> 1
      
      The issue: in order to handle the `fw` URL parameter (step 6.), we need to
      check the rights to ensure we can allow the website switch.
      To check rights, user need to be authenticated (step 5.), which is done after
      generating the routing map (2. & 3. & 4.).
      The routing map is generated based on the current website (step 1.)
      
      Step 6 depends of steps 5 which depends of steps 2/3/4 which depend of step 1,
      but step 1 should depend of step 6, which is an impossible cycle.
      
      closes odoo/odoo#70278
      
      X-original-commit: 878e28f9
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      Signed-off-by: default avatarRomain Derie <rdeodoo@users.noreply.github.com>
      0490828d
    • Laurent Smet's avatar
      [FIX] account: Fix price_unit rounding issue with fpos/price included tax · 3470a3c9
      Laurent Smet authored
      
      - Create an invoice with an empty fiscal position
      - Create a line with a product having 100.0 as sale price and 21.0% price-included tax
      => price_unit equals 99.99
      
      This is because 100 / 1.21 ~= 82.64 but 82.64 * 1.21 ~= 99.99 != 100.0.
      The bug only appears when managing a fiscal position because the code is trying to adapt the product price_unit to the newly computed taxes.
      
      closes odoo/odoo#69836
      
      X-original-commit: e2247a86
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      3470a3c9
  22. Apr 30, 2021
    • Adrien Widart's avatar
      [FIX] purchase_stock: consider product unit price precision · 77b7a23c
      Adrien Widart authored
      
      When changing the product price precision, this can lead to incorrect
      stock valuations.
      
      To reproduce the error:
      (Enable debug mode)
      1. Go to Settings > Technical > Database Strucutre > Decimal Accuracy
      2. Edit Product Price:
          - Digits: 4
      3. Create a Product Category PC:
          - Costing Method: FIFO
      4. Create a Product P:
          - Product Type: Storable Product
          - Product Category: PC
      5. Create a RfQ with product P:
          - Quantity: 1000
          - Unit Price: 0.035
      6. Confirm Order, Receive Products, Validate
      7. Click on Valuation
      
      Error: The total value is equal to $40 instead of $35. The calculation
      was done after rounding the unit price: $0.035 becomes $0.04, then
      1000*0.04=$40.
      
      When confirming the RfQ, a stock move is created. To do so, the method
      `_get_stock_move_price_unit` is called. When validating the delivery, it
      recomputes the unit price thanks to method `_get_price_unit`. In both
      situation, and if the line has taxes, the method `compute_all` is called
      like this:
      ```python
      price_unit = line.taxes_id.with_context(round=False).compute_all(price_unit,
      	currency=line.order_id.currency_id, quantity=1.0)['total_void']
      ```
      But here is the problem. In this method, total amount is computed with
      this line:
      ```python
      base = currency.round(price_unit * quantity)
      ```
      However, `quantity` is equal to 1 and the multiplication is rounded
      using the currency precision. As a result, `base` is equal to $0.04.
      Then, all computations will use this value and will be incorrect.
      
      This fix applies the real quantity so `base` will have the correct
      value:
      ```
      base = currency.round(price_unit * quantity)
           = currency.round(0.035 * 1000)
           = 35
      ```
      
      OPW-2472192
      
      closes odoo/odoo#70080
      
      X-original-commit: a57dc071
      Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
      77b7a23c
  23. Apr 28, 2021
  24. Apr 29, 2021
    • Arthur Detroux (ard)'s avatar
      [FIX] website: hide cookie bar when entering edit mode · 8c672662
      Arthur Detroux (ard) authored
      
      Previously :
      Once a user enabled the cookie bar, it prevented him from dropping
      snippets in the main area of the page because the focus was on
      the cookie bar. Dropping snippets there has a confusing behavior and
      might make the user think the editor is broken.
      
      Reason :
      The cookie bar has an oe_structure class and takes over the body
      if it's not hidden or dismissed. The oe_structure allows to drop
      snippets.
      
      Fix :
      Hiding the cookie bar when user enters edit mode to avoid dropping
      snippets in it by mistake.
      
      task-2477430
      
      closes odoo/odoo#68938
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      8c672662
  25. Apr 28, 2021
Loading