Openbravo Issue Tracking System - Modules
View Issue Details
0039485ModulesWarehouse Pickingpublic2018-10-18 17:032018-11-15 16:30
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
 
Sandrahuguet
0039485: Cannot Generate Picking List from multiple orders if there is not stock for one of them and it is grouped by business partner
Cannot Generate Picking List from multiple orders if there is not stock for one of them and it is grouped by business partner
As group admin role:
   Set Enable Stock Reservations to Y
   Log out and log in

   Apply module's dataset

   Create a sales order, add a product without stock in the order's warehouse and book it
   Create a similar sales order header, add a product with stock in the order's warehouse and book it
   Select both orders and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Group by business partner

   Check the following error message is shown:
      org.openbravo.base.exception.OBException

   The log shows:
      ERROR org.openbravo.warehouse.pickinglist.CreateActionHandler - Error in CreateActionHandler
org.openbravo.base.exception.OBException
    at org.openbravo.warehouse.pickinglist.CreateActionHandler.rollbackAndCloseAndThrowOBException(CreateActionHandler.java:352)
    at org.openbravo.warehouse.pickinglist.CreateActionHandler.doCreate(CreateActionHandler.java:286)
    at org.openbravo.warehouse.pickinglist.CreateActionHandler.execute(CreateActionHandler.java:84)
...
No tags attached.
related to defect 0039403 closed markmm82 Cannot Generate Picking List from multiple orders if there is not stock for one of them 
Issue History
2018-10-18 17:03ngarciaNew Issue
2018-10-18 17:03ngarciaAssigned To => Triage Finance
2018-10-18 17:03ngarciaResolution time => 1541026800
2018-10-18 17:03ngarciaIssue generated from0039403
2018-10-18 17:03ngarciaRelationship addedrelated to 0039403
2018-10-18 17:03ngarciaIssue Monitored: networkb
2018-10-18 17:18SandrahuguetResolution time1541026800 => 1541631600
2018-10-18 17:22eugeniNote Added: 0107447
2018-10-18 17:22eugeniIssue Monitored: eugeni
2018-10-22 11:15dmiguelezAssigned ToTriage Finance => AtulOpenbravo
2018-11-12 10:55SandrahuguetAssigned ToAtulOpenbravo => dmiguelez
2018-11-13 12:44SandrahuguetAssigned Todmiguelez => markmm82
2018-11-13 16:05markmm82Statusnew => scheduled
2018-11-14 05:01markmm82Note Added: 0107895
2018-11-15 16:15hgbotCheckin
2018-11-15 16:15hgbotNote Added: 0107934
2018-11-15 16:15hgbotStatusscheduled => resolved
2018-11-15 16:15hgbotResolutionopen => fixed
2018-11-15 16:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.warehouse.pickinglist/rev/5991ade1a201ed7a56ca66e2650b93c8d0627a81 [^]
2018-11-15 16:30SandrahuguetReview Assigned To => Sandrahuguet
2018-11-15 16:30SandrahuguetNote Added: 0107935
2018-11-15 16:30SandrahuguetStatusresolved => closed

Notes
(0107447)
eugeni   
2018-10-18 17:22   
Please, test also with Grouping criteria: Group by organization
(0107895)
markmm82   
2018-11-14 05:01   
For all the test cases:
As group admin role:
   Set Enable Stock Reservations to Y
   Log out and log in

   Apply module's dataset

Test Plan 1: Generating PL from an order without stock.
As group admin role:
  Create a sales order for Alimentos y Supermercados, S.A and España Región Norte warehouse, add a product without stock in the order's warehouse, for example Agua sin Gas 1L and book it.
   Select the order and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Not group
   Check the following error is shown:
   "Error
    There is not enough available stock"

   Select the order and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Group by business partner
   Check the following error is shown:
   "Error
    There is not enough available stock"

   Select the order and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Group by organization
   Check the following error is shown:
   "Error
    There is not enough available stock"

Test Plan 2: Generating PL from an order with partial stock.
   Create a sales order for Alimentos y Supermercados, S.A and España Región Norte warehouse.
   Add a line with a product without stock in the order's warehouse, for example Agua sin Gas 1L.
   Add a line with a product with stock in the order's warehouse, for example Cerveza Ale 0,5L.
   Book the order.
   Select the order and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Not group
   Check the Picking List was partially generated with the line with stock and the following message is shown:
   "Picking List created successfully
    PL378
    There is not enough stock in warehouses to create the whole Picking List. : [PL378]"
  
   Go to Warehouse Picking List window and cancel the previously created picking list, for example 378.

   Select the order and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Group by business partner
   Check the Picking List was partially generated with the line with stock and the following message is shown:
   "Picking List created successfully
    PL379
    There is not enough stock in warehouses to create the whole Picking List. : [PL379]"

   Go to Warehouse Picking List window and cancel the previously created picking list, for example 379.

   Select the order and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Group by organization
   Check the Picking List was partially generated with the line with stock and the following message is shown:
   "Picking List created successfully
    PL380
    There is not enough stock in warehouses to create the whole Picking List. : [PL380]"


Test Plan 3: Generating PL from an order with stock.
As group admin role:
  Create a sales order for Alimentos y Supermercados, S.A and España Región Norte warehouse, add a product with stock in the order's warehouse, for example Cerveza Ale and book it.
   Select the order and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Not group
   Check the picking list has been generated successfully, a success message is shown:
   "Picking List created successfully
    PL381"
   Go to Warehouse Picking List window and cancel the previously created picking list, for example 381.

   Select the order and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Group by business partner
   Check the picking list has been generated successfully, a success message is shown:
   "Picking List created successfully
    PL382"
   Go to Warehouse Picking List window and cancel the previously created picking list, for example 382.

   Select the order and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Group by organization
   Check the picking list has been generated successfully, a success message is shown:
   "Picking List created successfully
    PL383"
   Go to Warehouse Picking List window and cancel the previously created picking list, for example 383.


Test Plan 4: Generating PL from multiple orders without, partial and full stock.
  Create a sales order for Alimentos y Supermercados, S.A and España Región Norte warehouse, add a product without stock in the order's warehouse, for example Agua sin Gas 1L and book it.

  Create a sales order for Alimentos y Supermercados, S.A and España Región Norte warehouse.
   Add a line with a product without stock in the order's warehouse, for example Agua sin Gas 1L.
   Add a line with a product with stock in the order's warehouse, for example Cerveza Ale 0,5L.
   Book the order.

   Create a sales order for Alimentos y Supermercados, S.A and España Región Norte warehouse, add a product with stock in the order's warehouse, for example Cerveza Lager 0,5L and book it.

   Select all previously created orders (first with no stock, second with partial stock and third with stock) and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Not group
  Check two picking list have been created, one related to the order with partial stock and the other to the order with stock. Also is explained to the user the order from wich was not possible to generate the Picking List because no available stock. The following message is shown:
    "Picking List created successfully
     PL385, PL386
     There is not enough stock in warehouses to create the whole Picking List. : [PL386]
     There is not enough available stock for the following orders: 1000261"
  Notice that order 1000261 was the one without stock.

   Go to Warehouse Picking List window and cancel the previously created picking lists, for example 385 and 386.

   Select all previously created orders (first with no stock, second with partial stock and third with stock) and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Group by business partner
  Check two picking list have been created, one related to the order with partial stock and the other to the order with stock. Also is explained to the user the order from wich was not possible to generate the Picking List because no available stock. The following message is shown:
    "Picking List created successfully
     PL392
     There is not enough stock in warehouses to create the whole Picking List. : [PL392]
     There is not enough available stock for the following orders: 1000261"
  Notice that order 1000261 was the one without stock.
Notice that all the order lines with stock have been grouped into the PL392 Picking List.

  Go to Warehouse Picking List window and cancel the previously created picking lists, for example 392.

   Select all previously created orders (first with no stock, second with partial stock and third with stock) and launch Generate Picking List process:
      Picking List Type: Direct Picking List to Customer
      Grouping criteria: Group by organization
  Check two picking list have been created, one related to the order with partial stock and the other to the order with stock. Also is explained to the user the order from wich was not possible to generate the Picking List because no available stock. The following message is shown:
    "Picking List created successfully
     PL393
     There is not enough stock in warehouses to create the whole Picking List. : [PL393]
     There is not enough available stock for the following orders: 1000261"
  Notice that order 1000261 was the one without stock.
Notice that all the order lines with stock have been grouped into the PL393 Picking List.
(0107934)
hgbot   
2018-11-15 16:15   
Repository: erp/pmods/org.openbravo.warehouse.pickinglist
Changeset: 5991ade1a201ed7a56ca66e2650b93c8d0627a81
Author: Mark <markmm82 <at> gmail.com>
Date: Tue Nov 13 23:59:46 2018 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.warehouse.pickinglist/rev/5991ade1a201ed7a56ca66e2650b93c8d0627a81 [^]

Fixes issue 39485: Cannot Generate Picking List from multiple orders
if there is not stock for one of them and it is grouped by business partner or
organization.

Extracted the order document no and the order business partner name to variables
to avoid the need of refresh the order after be processed.

When an order had any line with enough available stock, the order was added as processed
into the Picking List description. To avoid it, the PL description is updated at the end
of the order processing, this way if a No Stock exception is thrown the description of the picking
list will not include the order.

Only is removed a Picking Lists from the lists if there is not enough available stock and
the PL is generated with "Not Grouping" option, because in the cases of PL creation based
on multiple orders it is possible that next orders can have stock and in this case can be
grouped without problems in the PL.

Was modified the Utilities.processOrder() method to initialize the pickingListObj with
the pickingList been processed, to get it always updated.

---
M src/org/openbravo/warehouse/pickinglist/CreateActionHandler.java
M src/org/openbravo/warehouse/pickinglist/Utilities.java
---
(0107935)
Sandrahuguet   
2018-11-15 16:30   
Code review + testing OK