Skip to content
Snippets Groups Projects
  1. Oct 08, 2020
  2. Oct 07, 2020
  3. Oct 08, 2020
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] stock: fix update of quantity in internal package transfer · 2dbb8ef1
      Andrea Grazioso (agr-odoo) authored
      
      Activate Delivery Packages option in the settings, and check "Move
      Entire Packages".
      Create a product, and update the quantity on hand (e.g. product X with 5
      quantity in package Y in location shelf 1)
      Then,create an internal transfer (e.g. package Y from shelf 1 to shelf
      2), check a first time the 'done' box and save.
      Finally, edit, uncheck and check again the 'done' box in the same
      operation and save.
      
      You will see (tracking message in the chatter) that the initial quantity
      is wrongly updated (doubled apparently).
      After saving, the 'done' box will be unchecked and the transfer cannot
      be validated with the following error message :
      "You cannot move the same package content more than once in the same
      transfer or split the same package into two location."
      
      This occur because on uncheck and recheck done checkbox the quantity is
      added again to the related move.
      
      opw-2350335
      
      closes odoo/odoo#59248
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      2dbb8ef1
  4. Oct 07, 2020
    • Nicolas Galler's avatar
      [FIX] mrp: validate BOM lines with same product as BOM · 881596f3
      Nicolas Galler authored
      
      Current behavior before PR:
      
      It is possible to create a BOM that has a BOM line that reference the
      same product as the BOM itself.  This is undesirable as when we create a
      manufacturing order for this product we will have an error.
      
      It is a regression bug that was introduced in commit
      575353e2 between v12 and v13.
      
      Behavior after PR is merged:
      
      When saving a BOM it will validate that no product line references the
      same product, or the same product variant, as the BOM itself.  Note that
      it is allowed to have a BOM for a product variant that references
      another variant of the same product.
      
      opw-2347941
      
      closes odoo/odoo#59181
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      881596f3
    • Nicolas Martinelli's avatar
      [FIX] mrp: group operator of duration per unit · df00fb73
      Nicolas Martinelli authored
      
      The Duration Per Unit should be averaged, not summed.
      
      opw-2353041
      
      closes odoo/odoo#59431
      
      X-original-commit: 54b40f1e
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      df00fb73
    • Fanny He's avatar
      [FIX] account: in loadData, pass the correct value to _formatLine · 05763e25
      Fanny He authored
      
      When lines are loaded in the reconciliation widget, get_bank_statement_data
      and get_bank_statement_line_data both return the same object containing e.g.
      {st_line: [], reconciliation_proposition: [], lines: []}.
      Then, the value of 'lines' should be passed to _formatLine. However
      in loadData, which is called after reconciling an entry, and if an additional
      line should be loaded in the reconciliation widget, the value passed was
      incorrect. Before saas-12.3, res['lines'] was passed to _formatLine. We
      do the same change to ensure the correct value is passed to _formatLine.
      
      opw 2299574
      
      closes odoo/odoo#59428
      
      X-original-commit: 924413c3666dbc4b69d57a67ec9c673e86a0bb6e
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      05763e25
    • IEL's avatar
      [FIX] calendar: correct list of today's meetings · aee99227
      IEL authored
      
      Before this commit, "Today's meeting" section of activities systray may have
      recurrent events for other days. This happens only if today is the first day
      of recurrent events.
      
      Technical reason for this error: filtering by start_date and
      stop_date doesn't work. You can see in method get_recurrent_ids that it checks only fields
      start, stop, final_date/
      
      opw-2345550
      
      closes odoo/odoo#59354
      
      X-original-commit: 1201732a
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      aee99227
    • Nasreddin (bon)'s avatar
      [FIX] point_of_sale: Error when adding product after printing the bill · d37efbc5
      Nasreddin (bon) authored
      
      Issue
      
      	- Install "Point of sale"
      	- Create a new one.
      	- Activate the "Is a Bar/Restaurant" feature and save
      	- Activate the "Bill Printing" feature then save
      	- Start a new session
      	- Add a product A
      	- Click on "Bill" then "Print"
      	- Then click on "Ok" to go back to order
      	- Add a product B
      
      	Error is raised ("Cannot read property 'add_product' of null").
      
      Cause
      
      	Trying to add a product to an order who is destroyed
      	if the bill has been printed.
      
      Solution
      
      	If the bill is printed (and not the receipt), set '_printed' of
      	the current order to 'false', therefore it will add the product
      	to the current order.
      
      opw-2341115
      
      closes odoo/odoo#59353
      
      Signed-off-by: default avatarbon-odoo <nboulif@users.noreply.github.com>
      d37efbc5
    • Kamesh Patel's avatar
      [FIX]*: clear breadcrumb when redirecting to activities from systray · 3bdc9948
      Kamesh Patel authored
      * mail,calendar,note
      
      Before this commit:
      
      When accessing activities from the systray, any existing breadcrumb-item should
      be clearer.
      
      After this commit:
      
      Clear breadcrumb-item when access activities from the systray.
      
      Task-2342246
      
      closes odoo/odoo#59364
      
      X-original-commit: 6dd181c7
      Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
      3bdc9948
  5. Oct 06, 2020
    • Anh Thao Pham (pta)'s avatar
      [FIX] delivery: hide Print Return Label for non-incoming picking · f54f485c
      Anh Thao Pham (pta) authored
      
      "Print Return Label" button on a Transfer is showed when `is_return_picking` field is True.
      But `is_return_picking` is True for any picking that is a return of another picking, making
      the button visible for the return of a return, when it should not as it is an outgoing picking.
      
      opw-2312425
      
      closes odoo/odoo#59287
      
      Signed-off-by: default avatarAnh Thao PHAM <kitan191@users.noreply.github.com>
      f54f485c
    • Nicolas Galler's avatar
      [FIX] base: do not crash if uploading a grayscale image · 9efe5608
      Nicolas Galler authored
      
      Behavior before the fix:
      
      Uploading a grayscale image with transparency in the company logo field
      of the document layout causes a crash:
      
      ```
        File "/data/build/odoo/addons/web/models/base_document_layout.py", line 89, in _compute_logo_colors
          wizard.logo_primary_color, wizard.logo_secondary_color = wizard_for_image._parse_logo_colors()
        File "/data/build/odoo/addons/web/models/base_document_layout.py", line 191, in _parse_logo_colors
          color[1][2] > white_threshold) and color[1][3] > 0:
      Exception
      
      ...
      IndexError: tuple index out of range
      ```
      
      To reproduce, use the `logo_ci.png` image included in the unit test
      data and load it in the document layout (under General Settings).
      
      The system does not detect that the image does not have color
      information and attempts to read the R,G,B values (but the image only
      has 2 values per pixel: the grayscale value and the alpha)
      
      Versions affected: 13, 14
      
      Behavior after the fix:
      
      The image is loaded correctly (arguably, there is not a lot of interest
      in detecting the primary color of a grayscale image, but the script
      still returns a (gray) value which is preferrable to a traceback)
      
      opw-2352394
      
      closes odoo/odoo#59275
      
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      9efe5608
  6. Oct 05, 2020
    • Siddarth Gajjar's avatar
      [FIX] website_slides: fix concurrency traceback · c5f406c8
      Siddarth Gajjar authored
      - Prior to this commit, slide content of type document or presentation is
        having src as '/slides/embed' and that controller tries to set slide as
        viewed. Along with this, for few slide types (including document and
        presentation) and for logged in user, it will try to set slide as completed
        once slide rendering is done with help of method `_setCompleted`, without
        waiting for the iframe to be loaded. This means, the controller called from
        the src of iFrame and the above method both tries to update same 'slide_slide'
        table at the same time, resulting into concurrency error.
      
      - This commit fixes the issue by marking the slide as completed (with help
        of method `_setCompleted`) only after the iFrame is loaded, avoiding the
        concurrent updation of 'slide.slide' table.
      
      TaskID 2265863
      Closes https://github.com/odoo/odoo/pull/52918
      
      
      
      closes odoo/odoo#52918
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      c5f406c8
  7. Oct 06, 2020
  8. Sep 18, 2020
  9. Oct 06, 2020
    • qsm-odoo's avatar
      [FIX] website: properly set button font family for navbar buttons · 9282f72c
      qsm-odoo authored
      
      Since 13.0, the website menu can contain text and buttons through
      mega menus, which created inconsistencies on the way the "navbar font"
      configuration works. Indeed, when setting the "button font", navbar
      buttons were updated too... except if that "button font" was equal to
      the "text font", in that case those buttons used the "navbar font", so
      not logical at all.
      
      This commit could solve the problem by only using the navbar font to
      style bootstrap nav links, which is the common content of mega menu
      snippets anyway but this would have a side-effect: text-in-navbar font
      may change from navbar font to text font which is not acceptable in
      stable versions. This will be changed for the very recent 14.0 though,
      especially since headers can now have more static text in that version.
      
      closes odoo/odoo#59291
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      9282f72c
    • oco-odoo's avatar
      [IMP] l10n_eu_service: remove old and confusing feature description from manifest · 40526577
      oco-odoo authored
      
      This feature description had stayed there since v8. Back at the day, we used to create one tax code per tax the module created. We removed this in v9, as similar result can be achieved by looking at the generic tax report.
      
      closes odoo/odoo#59195
      
      X-original-commit: 3a6aaa6e
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      40526577
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] account: fix auto-validate with post at bank reconciliation · ef612c17
      Andrea Grazioso (agr-odoo) authored
      
      - check the auto-validate field on the reconciliation model
      - set the post at bank reconciliation option in the Bank account
      - create a vendor bills with payment reference and register payment
      - create a matching bank statement
      - from the Accounting Overview, click on reconciliate
      
      Bank statement and payment are not reconciled automatically.
      This occur because when having 'post at' set to bank reconciliation the
      payment move of the vendor bill is not posted.
      
      opw-2336300
      
      closes odoo/odoo#59157
      
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      ef612c17
    • Harpritsinh Sisodiya's avatar
      [FIX] web_editor: fix oe_structure view that are not in extention mode · a944ce9b
      Harpritsinh Sisodiya authored
      
      Issue occurs due to the way we compute the default value in base ir ui view.
      The method _compute_defaults don't set extention mode under some condition
      even if we provide an inherit_id view.
      
      This commit double fix it, we use now self.env['ir.ui.view'] to create the
      new view and so always compute the mode based on 'if inherit id or not'.
      Second fixes is to explicitely set mode manually as 'extention'.
      
      before commit:
      when you drop snippet to blog sidebar and click save button.
      The changes of user is not visible in sidebar because view created in mode
      'normal' and not 'extention'
      
      task-2311520
      closes odoo/odoo#55908
      
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      Co-authored-by: default avatarjpr-odoo <jpr@openerp.com>
      a944ce9b
  10. Sep 29, 2020
    • Swapnesh Shah's avatar
      [FIX] purchase_account: consider archived valuation layers · bedbc577
      Swapnesh Shah authored
      
      Before this this commit there would be `ZeroDivisionError` if product is archived.
      
      Steps to Reproduce Issue:
         Create product with AVCO and Automated Valuation
         Create PO and Received all Quantities
         Archive Product
         Create Bill and Post
      
         There will be Traceback
         ```
      File "/data/build/odoo/addons/purchase_stock/models/account_invoice.py", line 84, in _stock_account_prepare_anglo_saxon_in_lines_vals
          valuation_price_unit = valuation_price_unit_total / valuation_total_qty
      ZeroDivisionError: division by zero
         ```
      
      Now we consider Archived `stock_valuation_layer_ids` as well.
      
      closes odoo/odoo#54610
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      bedbc577
  11. Oct 06, 2020
  12. Oct 05, 2020
    • Tiffany Chang (tic)'s avatar
      [FIX] stock: correct validated inventory date · e69aca7d
      Tiffany Chang (tic) authored
      
      Currently the help of stock_inventory.date includes:
      "If the inventory adjustment is validated, date at which the inventory
      adjustment has been validated."
      
      But for some reason this isn't the case. This commit makes it so we now
      update the `date` when the inventory is validated. Since no one
      previously complained about this, we only apply it to newly validated
      inventories and leave existing ones as is. Note this change makes the
      `accounting_date` help accurate (i.e generated account moves already
      use the date when the inventory is validated when no accounting date
      set, so before this fix the dates won't match).
      
      Discovered during task: 2336455
      
      closes odoo/odoo#59124
      
      X-original-commit: 1da01214
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      e69aca7d
  13. Oct 02, 2020
    • Raphael Collet's avatar
      [FIX] core: optimize prefetching on large recordsets · d0d54d63
      Raphael Collet authored
      
      This patch optimizes the performance of prefetching when iterating on
      large recordsets.  The optimization is *transparent*, i.e., it requires
      no code change for it to apply.
      
      The worst-case scenario for prefetching is the following: the ORM has to
      fetch a field for a given `record`, `record._prefetch_ids` (its prefetch
      set) is *very* large (many thousands), and most records in the prefetch
      set are already in cache.  This requires the ORM to iterate a lot on the
      prefetch set in order to make a batch of records not having the field in
      cache.
      
          records = model.browse(ids)     # large recordset
          for record in records:
              record.foo                  # fetch 'foo' every 1k records
      
      When running such a loop on an empty cache, the overhead of prefetching
      (determine a batch) grows as the loop progresses.  The time complexity
      of this loop is actually O(N²)...
      
      The overhead of prefetching is minimal when `record._prefetch_ids` is
      about the size of a prefetching unit, i.e., 1k records.  This commit
      modifies the iterator method such that every record returned by the
      iterator has a prefetch set of maximum 1k records.
      
      We measured the time taken by the loop above on an empty cache, before
      and after this commit, on a simple model (res.partner.category) with
      100k records.  The third measure is a reference one: a `_read` on all
      prefetched fields (to fill in the cache) followed by the loop.
      
                                  Total time      Time per 1k records
          Before this commit      3.690s          30ms - 45ms
          After this commit       1.176s          12ms
          Read then loop          1.161s          -
      
      The measures are enlightening: the overhead of prefetching was more than
      200% of the reference time, and the time to prefetch records grows as
      the iteration goes on!  This commit reduces the overhead of prefetching
      to less than 2% of the reference time, and make it scale gracefully with
      data size.
      
      closes odoo/odoo#59008
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      d0d54d63
  14. Oct 05, 2020
  15. Oct 06, 2020
    • Priyanka Kakadiya's avatar
      [FIX] web: send utc date to server from daterange widget · 751f90a5
      Priyanka Kakadiya authored
      When manually updating the time on a daterange widget, the value sent to the
      server is not converted to UTC and is sent as it appears on the input.
      
      currently daterange widget send datetime value as it is, written in input field
      if manually entered, so if user set 10:00:00 so while sending data it will be
      send as it is 10:00:00 so when next time record reloaded after save, it will
      display 15:30:00 if timezone UTC+5:30.
      
      Instead, change the string date to moment object with current user timezone.
      so that datetime send to server is UTC time and when next time it is loaded
      it adds user timezone difference, so if timezone is UTC+5:30 and user enters
      10:00:00 then while sending data to server it sends 04:30:00 and when displayed
      again after reload it adds +5:30 timezone difference.
      
      LINKS
      
      PR https://github.com/odoo/odoo/pull/50132
      
      
      Task 2240378
      
      closes odoo/odoo#50132
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      Co-authored-by: default avatarMohammed Shekha <msh@odoo.com>
      751f90a5
Loading