Skip to content
Snippets Groups Projects
  1. Sep 01, 2021
    • Tiffany Chang (tic)'s avatar
      [FIX] stock: ensure safe UoM change for done smls · 3f4654f9
      Tiffany Chang (tic) authored
      
      We fix 2 related UoM issues:
      
      1. Fix quant inconsistency from changing the UoM of Done
         stock.move.lines
      
      Steps to reproduce:
      - Enable "Storage Locations" setting
      - Create a new "Storable Product" and create a receipt for 1 unit of it
      - Validate the 1 unit receieved
      - Open "Detailed Operations" of the move and change the stock.move.line
        UoM to dozen.
      
      Expected result: 13 on hand
      Actual result: 1 on hand
      
      To fix this:
      - prevent users from editing the UoM after the picking is
        done (i.e. unless adding a new stock.move.line and not saving).
      - update the write on done logic so stock.move.line UoM changes are
        considering and will update the quant correctly (in case of RPC or
        direct write).
      
      2. Prevent changing UoM of Done stock.move to prevent inconsistent field
      values within stock.move and confusion for users
      
      Steps to reproduce:
      - Complete a picking (incoming is easiest to see) with a new product
        (i.e. 0 qty) having 1 unit done.
      - Unlock picking and add a new stock.move with 1 unit done and save.
      - Edit the just added stock.move's UoM from Units to Dozen.
      - Check the quantity on hand / Done qty of stock.move after leaving and
        returning to form.
      
      Expected result: 13 On Hand
      Actual Result: 2 On Hand and the "Done" qty in the picking is 0.0083
        (i.e. 1/12 of a dozen)
      
      To fix this:
      - prevent users from editing the UoM after the picking is done (unless
        adding a new stock.move and not saving)
      - if a Done stock.move UoM is uodated, a UserError occurs because there
        is no straightforward way to ensure the quant is updated correctly
        since is handled within the move.line (i.e. has no visibility to its
        move's uom change => changing only UoM and not qty done will result in
        no quant update)
      
      closes odoo/odoo#75621
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      3f4654f9
  2. Aug 30, 2021
    • Sébastien Alix's avatar
      [FIX] registry: check if index exists before logging · 57f078b6
      Sébastien Alix authored
      
      The `update_db_index` method is called even if the field has no index
      (the check on `index` field attribute is here on purpose).
      
      Before 13f02a60 was applied, the call of `sql.drop_index` was taking
      care of the index existence if a `IF EXISTS` SQL statement, so even if
      the field had no index it wasn't causing any issue.
      
      With 13f02a60 applied, the log 'Keep unexpected index' is spam even if
      the field has actually no index at all in the database.
      
      This commit ensures to check the existence of the index before logging.
      
      closes odoo/odoo#75387
      
      Signed-off-by: default avatarXavier Morel (xmo) <xmo@odoo.com>
      57f078b6
  3. Aug 29, 2021
  4. Aug 27, 2021
  5. Aug 26, 2021
  6. Aug 24, 2021
  7. Aug 23, 2021
  8. Aug 22, 2021
  9. Aug 19, 2021
  10. Jun 04, 2021
    • Nicolas Seinlet's avatar
      [FIX] registry: avoid dropping indexes · 13f02a60
      Nicolas Seinlet authored
      
      When an index has name 'tablename_fieldname_index', this index is
      dropped if the field has index=False.  This lead to dropping a
      user-created index or dropping/recreating the index when index=True is
      set in a dependent module.  Some info is logged instead.
      
      closes odoo/odoo#66700
      
      closes odoo/odoo#71761
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      13f02a60
  11. Aug 16, 2021
    • Bhavesh Odedra's avatar
      [FIX] account: check if tax name on copy method · 7ba56a2d
      Bhavesh Odedra authored
      With this commit, it will check if the tax name is given by external method and take that name if any.
      
      For example,
      vals = {'rate': 5.2, 'name': 'Odoo New Tax'}
      tax_template = self.env['account.tax'].search(domain, limit=1)
      new_tax = tax_template.copy(default=vals)
      
      Current Behavior:
      new_tax.name => 'Odoo New Tax (Copy)'
      
      Instead of 'Odoo New tax'
      
      closes odoo/odoo#74722
      
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      7ba56a2d
  12. Aug 12, 2021
  13. Aug 18, 2021
    • Raf Geens's avatar
      [FIX] base_gengo: Gengo callback tracebacks · f8fa9321
      Raf Geens authored
      
      There's two ways Odoo can get job responses from Gengo: the first is
      this callback, initiated by Gengo. The second is a cronjob ran by Odoo
      which retrieves translated terms. The callback resulted in a traceback
      in the logs, because there was a typo in 'base.gengo.translations' (it
      was missing an -s at the end). `json.loads` was also being called with
      an unexpected extra parameter ('utf-8'), resulting in another traceback.
      
      This PR fixes both of those and I was able to confirm the callback was
      able to update translations in Odoo as a result.
      
      closes odoo/odoo#75230
      
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      f8fa9321
  14. Aug 17, 2021
  15. Aug 16, 2021
  16. Aug 15, 2021
  17. Aug 13, 2021
    • Guillaume (guva)'s avatar
      [FIX] event_sale : compute attendees on cancel SO · 2fcc8a71
      Guillaume (guva) authored
      
      Steps to reproduce:
      
      - create a sale order with an event registration,
      - on the event, the number of attendees is well computed
      - cancel the sale order
      - on the event, the number of attendees is still the same as before
      
      Cause of the issue
      
      There was no specific action for canceling a sale order linked
      to an event registration
      
      Solution
      
      Add a action_cancel method which cancel also the sale order lines when
      canceling the sale order
      
      Also add a test to ensure the flow will not break in the future
      
      opw-2576790
      
      closes odoo/odoo#74481
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      2fcc8a71
  18. Aug 06, 2021
    • std-odoo's avatar
      [FIX] website_crm_partner_assign: fix a traceback when null probability · 6453a03e
      std-odoo authored
      
      Bug
      ===
      1. Login as "Portal"
      2. Go to "/my/opportunity"
      3. Create an opportunity
      4. Edit this opportunity from the frontend and set the probability empty
      => Save, an error is raised
      
      Technical
      =========
      The probability is set to "None" and not to "False", therefor the
      verification "probability >= 100" in the write method of the lead will
      raise an error.
      
      By using False instead of None, this verification will work.
      
      Task-2613208
      
      closes odoo/odoo#74790
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      6453a03e
  19. Aug 12, 2021
    • Nicolas Lempereur's avatar
      [FIX] web: pdf.js courier font ok with chrome 92 · eeff8c08
      Nicolas Lempereur authored
      In new version of chrome (92) or firefox when some fonts (eg. courier)
      were used:
      
      - either the page would never finish loading (odoo 13 and below)
      - or the text would in this font would not be shown (odoo 14 and over)
      
      This was solved in pdf.js whith this commit:
      
      https://github.com/mozilla/pdf.js/commit/8805614a03
      
      
      
      And this PR is backporting that commit in 12.0 version up to master.
      
      opw-2621405 opw-2613412 opw-2620186 opw-2618225 opw-2616690 opw-2615502
      opw-2616249 opw-2615144 opw-2613969 opw-2613793 opw-2618129 opw-2617736
      opw-2622506 opw-2614508 opw-2620883 opw-2622105 opw-2620863 opw-2615326
      opw-2622842 opw-2620220 opw-2622842 opw-2620220 opw-2615346 opw-2615026
      opw-2618389 opw-2619382 opw-2613286 opw-2621730 opw-2613412 opw-2622029
      opw-2620625 opw-2622311
      
      closes #75020
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      eeff8c08
  20. Aug 10, 2021
    • Nasreddin Boulif (bon)'s avatar
      [FIX] stock: use docids as product_id in report · de6b1636
      Nasreddin Boulif (bon) authored
      
      Steps to reproduce:
      
        - Install Inventory and Studio modules
        - Go to Inventory -> Products -> Products
        - Open Studio
        - Click on Reports tab
        - Select `Product Routes Report`
      
      Issue:
      
        Traceback is raised.
      
      Cause:
      
        No 'product_id' provided in data while getting report values.
      
      Solution:
      
        If no `product_id` key or value in data, set `docids` (or an empty
        list if no docids) as product_id and set 'warehouse_ids'
        to an empty list.
      
      opw-2619142
      
      closes odoo/odoo#74860
      
      Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
      de6b1636
  21. Aug 09, 2021
  22. Aug 08, 2021
  23. Aug 06, 2021
  24. Jul 21, 2021
  25. Aug 03, 2021
  26. Aug 01, 2021
  27. 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
  28. 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
  29. Jul 23, 2021
  30. 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
  31. Jul 15, 2021
  32. Jul 25, 2021
Loading