Skip to content
Snippets Groups Projects
  1. Sep 08, 2023
    • Richard deMeester's avatar
      [FIX] stock: change UOM on product block - multi company · fad9d559
      Richard deMeester authored
      
      There is code to block the UOM changing if there are done moves.
      
      Because it searches in non-sudo mode, it does NOT currently
      stop you changing the UOM if the product has moves in a different
      company.
      
      closes odoo/odoo#134807
      
      X-original-commit: 42674464
      Signed-off-by: default avatarTiffany Chang (tic) <tic@odoo.com>
      fad9d559
    • Walid's avatar
      [FIX] stock: forecast button color · 95414e8c
      Walid authored
      
      Steps to reproduce:
      - Enable multistep routes (3 steps delivery)
      - Create a new storable product (0 on hand quantity)
      - Confirm an SO with that product
      
      Bug:
      forecast button is correctly red on the SO line but it's green on the
      stock pickings
      
      Fix:
      button should be green if it's possible to reserve quantity red otherwise
      
      opw-3440627
      
      closes odoo/odoo#134841
      
      X-original-commit: 0312c1bdc371e5a841b8d9e620c9fd7a49782b15
      Signed-off-by: default avatarQuentin Wolfs (quwo) <quwo@odoo.com>
      Signed-off-by: default avatarWalid Hanniche (waha) <waha@odoo.com>
      95414e8c
    • Adrien Widart (awt)'s avatar
      [FIX] stock: check SN uniqueness by location · 47cdc122
      Adrien Widart (awt) authored
      
      To reproduce the issue:
      1. In Settings, enable:
         - Storage Locations
         - Package
      2. Create a product P
         - Type: Storable
         - Tracked by SN
      3. Process a receipt with 1 x P, serial S
      4. Return P in a package
      5. Process a new receipt with 1 x P, still S as SN
      
      Error: An error is displayed "The serial number has already been
      assigned [...]". This is incorrect, the user should be able to
      receive that SN.
      
      After step 3, there exists a quant Q1: -1 x P at Supplier Location
      with S. Then, after step 4, a new quant Q2 is created: 1 x P at
      Supplier Location with S and the package. Because the field
      `package_id` is not the same on Q1 and Q2, both quants are not merged.
      
      As a result, step 5, we will update Q1 and have -2 x P at Supplier
      Location with S. This will trigger the constraint, hence the error
      message.
      
      OPW-3390615
      
      closes odoo/odoo#134727
      
      X-original-commit: 3a501855e65b6e82004d67beeecffe7286cc682b
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarAdrien Widart (awt) <awt@odoo.com>
      47cdc122
  2. Sep 06, 2023
  3. Sep 03, 2023
  4. Aug 27, 2023
  5. Aug 24, 2023
    • Renilkumar Kajavadra's avatar
      [FIX] stock: multiple warehouses in replenishment · b90dfc98
      Renilkumar Kajavadra authored
      Company can have multiple warehouses,
      when user open replenishment and company has multiple warehouses.
      this will lead to below traceback.
      
      Steps to reproduce the error:
      - Go to 'Manufacturing' > Configuration > Settings > Enable Subcontracting
      - Go to 'Contacts' > Create a Contact > Sales & Purchase >
        Open Subcontractor Location > Enable Replenish Location
      - Go to 'Inventory' > Configuration > Warehouses > Create multiple warehouses
      - Create a storable product > Create BoM > Set Subcontracting in BoM Type >
        Set already created contact in Subcontractors > Save
      - Go to 'Purchase' > Set Subcontractor in Vendor > Add Product > Confirm Order
      - Go to 'Inventory' > Operations > Replenishment
      
      Error: A traceback appears:
      'ValueError: Expected singleton: stock.warehouse(1, 2, 3, 4)'
      
      https://github.com/odoo/odoo/blob/3864542914efcb9d4e3cabd3cfdeecb842e4f380/addons/stock/models/stock_orderpoint.py#L414
      
      
      here, we can get multiple warehouses for a company.
      So it will lead to above traceback.
      
      sentry-4358838167
      
      closes odoo/odoo#131055
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      b90dfc98
  6. Aug 21, 2023
  7. Aug 20, 2023
  8. Aug 18, 2023
    • Mahdi Cheikh Rouhou (macr)'s avatar
      [FIX] stock : prevent creating sequences with same code · 9034602a
      Mahdi Cheikh Rouhou (macr) authored
      
      Issue:
      ======
      You can create the same sequence with the same code
      
      Steps to reproduce the error:
      =============================
      - Install inventory and activate storage locations
      - Go to inventory/configuration/Operations Types
      - Create 2 operation typs with the following values:
      name :any random name , type of Operations : internal transfer,
      sequence prefix : test , locations as WH/Stock
      - Go to sequences and search for test
      - You will have 2 duplicate sequences with the same values
      
      Origin of the problem :
      =======================
      - Creating an operation type always creates atuomatically a sequences if
        the sequence_code is provided but the sequence_id isn't.
      
      Solution:
      =========
      Display an error when the name already exist.
      
      opw-3238331
      
      closes odoo/odoo#129394
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      9034602a
  9. Aug 16, 2023
    • Walid's avatar
      [FIX] stock: return packages · 9d2d3911
      Walid authored
      
      Steps to reproduce:
      - Deliver an SN-tracked product with the Destination Package set (put in pack button also sets this).
      - Return that product without setting the Source Package (you can also click "put in pack" which will put the product in yet another pack).
      - This already results in two lines with the same SN in the same location, one with +1.00 and one with -1.00 quantity.
      - Deliver that product again and put in pack.
      - Now there's three lines with the same SN in the same location, two with +1.00 and one with -1.00 quantity.
      
      Bug:
      source Package isn't set bydefault when confirming the move_line
      we update the stock quantity for that lot_id and Package set to False
      the existing quantity has a Package set so it is filtered out and a new
      negative quantity is created
      
      Fix:
      set the source Package on the return
      
      opw-3179388
      
      closes odoo/odoo#131358
      
      X-original-commit: eb989688ac2db026077d84a3f55321bc6bf44504
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarAdrien Widart (awt) <awt@odoo.com>
      9d2d3911
  10. Aug 13, 2023
  11. Aug 09, 2023
    • Michele's avatar
      [IMP] stock: gather_domain in dedicated function · 4abc47a5
      Michele authored
      
      With this commit you wil have the function _get_gather_domain so you can override and manage the gather_domain by your own logic
      
      closes odoo/odoo#130916
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      4abc47a5
    • Adrien Widart (awt)'s avatar
      [FIX] stock: ignore locations without storage category · 7ba66b8b
      Adrien Widart (awt) authored
      
      On a putaway rule, the "Having Category" condition is not always
      respected.
      
      To reproduce the issue:
      1. In Settings, enable:
         - Storage Locations
         - Storage Categories
      2. Create a Storage Category SC:
      3. Create two locations L1, L2:
         - Parent: WH/Stock
         - Type: Internal
         - L2 only:
           - Storage Category: SC
      4. Create a putaway rule:
         - When in: WH/Stock
         - Store to: WH/Stock
         - Having Category: SC
      5. Create one storable product
      6. Update its on hand quantity:
         - 1 product at L1
      7. Create a planned receipt R for one product
      8. Mark the receipt as Todo
      9. Click on 'Set Quantities'
      10. Open the detailed operations
      
      Error: The destination location is L1. The putaway rule has been
      applied without the storage category constraint: the destination
      location should be L2
      
      When applying the putaway rules, we first check if one of the
      relevant locations already contains that product. And, if it's the
      case, we use that location as destination location. However, we
      don't filter out the locations without the correct storage category.
      This explains why L1 is found and used.
      
      OPW-3437174
      
      closes odoo/odoo#131189
      
      X-original-commit: 66c11acd
      Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
      Signed-off-by: default avatarAdrien Widart (awt) <awt@odoo.com>
      7ba66b8b
  12. Aug 06, 2023
  13. Aug 03, 2023
    • Touati Djamel (otd)'s avatar
      [FIX] stock:use manufacture security LT if manufacture is selected in RR · 0a1f1464
      Touati Djamel (otd) authored
      
      Steps to reproduce the bug:
      - Assume the current date is August 1, 2023.
      - Go to general settings:
          - set purchase security lead time: 20 days
          - set manufacturing security lead time: 25 days
      
      - Create a storable product “P1”
          - Routes: Manufacture + buy
          - Manufacture lead time: 1 day
      
      - Create an order point:
         - preferred route: Manufacture
         - Quantity to order: 5
         - Click on “Order once”
      
      Problem:
      A manufacturing order is created, but the "Scheduled Date" is incorrect.
      Instead of being set to August 1, 2023, it shows August 7th.
      
      The issue occurs because initially, we calculate the `Lead days date`
      as follows:
      Today's date (August 1st) + manufacturing security lead time (25)
      + Manufacturing Lead Time (1) = August 27th.
      However, we use the purchase security lead time (20) instead of the
      manufacturing so 27 - 20 = August 7th
      
      To determine the exact date, we call the function
      `_get_date_with_security_lead_days`. In which we try to get the
      appropriate rule to use. However, in this case, the preferred route
      of the orderpoint is not passed as a parameter to the function.
      Therefore, we use the first rule of the first route ("buy"), and we end
      up using its security lead time.
      
      opw-3439546
      
      closes odoo/odoo#130431
      
      Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
      0a1f1464
    • Abdelouahab (abla)'s avatar
      [FIX] stock: don't require lot_id on reporting/location · 768b1755
      Abdelouahab (abla) authored
      To Reproduce
      =============
      - enable multi step routes
      - edit Receipts operation and uncheck the two options under Traceability
      - create storable product with Traceability using lot/serial number
      - make purchase of this product and receive it in your inventory
      - under inventory/reports/Locations click on line of this product
      you will be stuck at that page even if you click discard
      
      Problem
      =======
      There is an inconsistency between the view and backend, as we allow
      receiving traceable product without setting `lot_id`, but in view
      require `lot_id` if tracking is enabled on product.
      
      Solution
      ========
      following this [comment](https://github.com/odoo/odoo/blob/16.0/addons/stock/models/stock_move_line.py#L558-L560
      
      ), `lot_id` shouldn't be required on view.
      
      opw-3422259
      
      closes odoo/odoo#129322
      
      Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
      768b1755
  14. Jul 30, 2023
  15. Jul 23, 2023
  16. Jul 20, 2023
  17. Jul 19, 2023
    • Louis Wicket (wil)'s avatar
      [FIX] mail, *: fix grammar error in field help · 57ece624
      Louis Wicket (wil) authored
      
      This commit fixes a really old grammar error in the help message of the
      message_needaction_counter field.
      
      Before this commit: “Number of messages which requires an action”
      After: “Number of messages requiring action”
      
      The subject of “require” is “messages”, which is third-person plural, so
      it can't take the -s suffix.
      
      closes odoo/odoo#128929
      
      Related: odoo/enterprise#44299
      Signed-off-by: default avatarLouis Wicket (wil) <wil@odoo.com>
      57ece624
  18. Jul 18, 2023
    • Walid HANNICHE (waha)'s avatar
      [FIX] stock: return packages · ca168f7f
      Walid HANNICHE (waha) authored
      
      Steps to reproduce:
      - Deliver an SN-tracked product with the Destination Package set (put in pack button also sets this).
      - Return that product without setting the Source Package (you can also click "put in pack" which will put the product in yet another pack).
      - This already results in two lines with the same SN in the same location, one with +1.00 and one with -1.00 quantity.
      - Deliver that product again and put in pack.
      - Now there's three lines with the same SN in the same location, two with +1.00 and one with -1.00 quantity.
      
      Bug:
      source Package isn't set bydefault when confirming the move_line
      we update the stock quantity for that lot_id and Package set to False
      the existing quantity has a Package set so it is filtered out and a new
      negative quantity is created
      
      Fix:
      set the source Package on the return
      
      opw-3179388
      
      closes odoo/odoo#126308
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      ca168f7f
  19. Jul 17, 2023
  20. Jul 16, 2023
  21. Jul 14, 2023
  22. Jul 11, 2023
    • Arnold Moyaux's avatar
      [FIX] stock: Usererror during PO import · 81138b4d
      Arnold Moyaux authored
      
      Usecase to reproduce:
      - Create and validate a PO + receipt
      - Import a file containing a different PO line quantity
      
      Expected behavior:
      The PO line is modified and the receipt has the a new move
      
      Current behavior:
      UserError asking to modify the quantity done of stock.move.line instead
      reserved quantity.
      
      Following commit 76ad7b7d
      
      The purpose is to block import with reserved quantity
      
      It happens because the PO line import trigger the creation of a new
      stock.move and reserve it (create the stock.move.line). However since
      it's created by the system the data are correct.
      
      There is no issue in multiple step since the internal step requires
      the move_orig_ids and thus the product_uom_qty is empty
      
      To fix it:
      - Relax the constraint to only consider sml having an impact on quant
      
      opw-3336131
      
      closes odoo/odoo#127888
      
      X-original-commit: 38468d0364519cf90c2546cc4a11b93da195b604
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      81138b4d
  23. Jul 09, 2023
  24. Jul 02, 2023
  25. Jun 29, 2023
  26. Jun 27, 2023
    • Mathieu Walravens's avatar
      [FIX] stock: prevent merging quants during import · a381b6fd
      Mathieu Walravens authored
      
      Before this commit:
      When importing `stock.quant` with two lines with the same product and
      different counted quantities, only the last line is taken.
      
      After this commit:
      Each line creates a `stock.quant`, even if a similar Quant exists.
      The records will be merged at a later time by `_merge_quants`.
      
      Steps to reproduce:
      1. Create a storable product
      2. Go to Inventory > Operations > Inventory Adjustments
      3. Create a file with two lines with the same product,
          and different counted quantities
      5. Favourites > Import Records & upload the file
      
      OPW-3340017
      
      closes odoo/odoo#126458
      
      X-original-commit: 45f7368222ead5df600992c66f0da56b3a7e959a
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarWalravens Mathieu (wama) <wama@odoo.com>
      a381b6fd
  27. Jun 25, 2023
  28. Jun 23, 2023
  29. Jun 20, 2023
  30. Jun 18, 2023
  31. Jun 15, 2023
  32. Jun 12, 2023
    • Eteil Djoumatchoua(etdj)'s avatar
      [FIX] stock: Enable the creation of a transfer from a duplicated operation type · 52219871
      Eteil Djoumatchoua(etdj) authored
      
      Steps:
      1- Duplicate inventory operation - Delivery Order
      2- Process new order with duplicate
      3- Add products and try to save
      
      Issue:
      Traceback
      
      Cause:
      The ORM tries to insert a new record of stock.picking but triggers a constraint on unique(name, company_id). When creating a new transfer the name is computed from the sequence of the stock.picking.type but here when we duplicate a stock.picking.type it creates a new sequence which starts with id 1, if the there is already a transfer with uses it the constraints will be triggered. We just have to make the stock.picking.type which are duplicated use the same sequence
      
      Solution:
      Enable the copy of the sequence_id so that two ``stock.picking`` from duplicated operation types will never collide on their name.
      
      opw-3331835
      
      closes odoo/odoo#122838
      
      Signed-off-by: default avatarAdrien Widart (awt) <awt@odoo.com>
      52219871
  33. Jun 11, 2023
  34. Jun 09, 2023
    • smna-odoo's avatar
      [FIX] stock: add SM without scheduled date · 48914c3e
      smna-odoo authored
      If a user adds a new SM to a picking without any scheduled date,
      traceback will appear
      
      To reproduce the issue:
      1.  create a new picking and remove the scheduled_date.
      2.  try to add a new storable product in move lines.
      
      Error: A traceback appears: "TypeError: '>' not supported between
      instances of 'datetime.datetime' and 'bool'"
      
      On the picking form, the default SM date is the scheduled date of the
      picking:
      https://github.com/odoo/odoo/blob/2c3f53d5a0380e7de27977f56f20307ff2bccabf/addons/stock/views/stock_picking_views.xml#L358
      
      
      Therefore, in the above use case, when triggering the onchange/compute
      methods, the field `date` of the SM will not be defined. At some
      point, we need to get the forecasted quantities of the SM product
      (see the method updated by this commit) and, to do so, we compare
      the SM date with `now`. Since this date is `False`, it will lead to the
      above traceback
      
      sentry-3979281197
      
      closes odoo/odoo#124274
      
      X-original-commit: e6179a51
      Signed-off-by: default avatarAdrien Widart (awt) <awt@odoo.com>
      48914c3e
Loading