Openbravo Issue Tracking System - Modules
View Issue Details
0035542ModulesWarehouse Pickingpublic2017-03-16 14:222017-03-24 14:30
ngarcia 
aferraz 
urgentmajoralways
closedfixed 
5
 
 
markmm82
0035542: Wrong stock reservation when deleting lines or canceling partially shipped orders' picking lists
Wrong stock reservation when deleting lines or canceling partially shipped orders' picking lists
As group admin role:
   Apply the module's dataset in F&B US Inc.
   Set the Enable Stock Reservations preference to Y
   Log out and log in

   Create a new product in F&B US Inc.
   Receive the following units of it:
      - 40 units in WC-0-0-0
      - 40 units in WC-1-0-0
      - 40 units in WC-2-0-0
   Create a sales order of 100 units of the product
   Generate Picking List from it
   Delete the lines in bins WC-1-0-0 and WC-2-0-0
   Edit the line in bin WC-0-0-0 and reduce the quantity to 5
   Process it
   Generate a new Picking List from the order
   Cancel it
   The reserved quantity of the stock reservation with a released quantity of 5 is not updated, so 35 units are still reserved against that order. This is not correct.
   
   Generate a new Picking List from the order
   Delete the line with WC-2-0-0 bin
   The reservation is not removed, 5 units are still reserved on this bin. This is not correct.

   Click on Edit Lines, select the previously deleted line and add 20 units
   Check a reservation line of 25 units has been made, having a reservation of 105 units against an order of 100 units. This is not correct.

   Delete the line again
   Cancel the picking list.
   Check the reservation line is not removed. This is not correct.
No tags attached.
related to defect 0029169 closed reinaldoguerra Cannot delete a picking list line if the sales order line was delivered in another goods shipment 
related to defect 0032651 closed markmm82 Stock Reservations are not deleted when cancelling a picking list if the reserved quantity has decimals 
related to defect 0029966 closed jorge-garcia Warehouse Picking List cannot be canceled if it has been shipped on another different shipment 
related to defect 0035600 new Triage Omni WMS An exception is thrown in Eclipse and the popup to Delete line in the PL is not opened 
blocks defect 0035616 closed collazoandy4 Wrong stock reservation when deleting partially shipped orders' picking lists lines 
Issue History
2017-03-16 14:22ngarciaNew Issue
2017-03-16 14:22ngarciaAssigned To => Triage Finance
2017-03-16 15:26ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14832#r14832
2017-03-16 15:27ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14833#r14833
2017-03-16 15:27ngarciaIssue Monitored: networkb
2017-03-16 15:29ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14834#r14834
2017-03-16 19:32markmm82Assigned ToTriage Finance => collazoandy4
2017-03-16 19:46mcobasStatusnew => scheduled
2017-03-16 19:54mcobasAssigned Tocollazoandy4 => mcobas
2017-03-17 09:00ngarciaResolution time => 1491429600
2017-03-17 09:43aferrazAssigned Tomcobas => aferraz
2017-03-17 10:54aferrazNote Added: 0095362
2017-03-17 10:54aferrazNote Deleted: 0095362
2017-03-17 11:02aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14843#r14843
2017-03-17 11:24aferrazRelationship addedrelated to 0029169
2017-03-17 12:53aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14844#r14844
2017-03-17 13:17aferrazSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14845#r14845
2017-03-17 13:17ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14846#r14846
2017-03-17 14:33aferrazNote Added: 0095379
2017-03-17 14:36aferrazRelationship addedrelated to 0032651
2017-03-17 14:37aferrazRelationship addedrelated to 0029966
2017-03-20 16:57jfrancesIssue Monitored: jfrances
2017-03-21 19:08markmm82Note Added: 0095487
2017-03-21 19:09markmm82Note Edited: 0095487bug_revision_view_page.php?bugnote_id=0095487#r14858
2017-03-22 15:52hgbotCheckin
2017-03-22 15:52hgbotNote Added: 0095505
2017-03-22 15:52hgbotStatusscheduled => resolved
2017-03-22 15:52hgbotResolutionopen => fixed
2017-03-22 15:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.warehouse.pickinglist/rev/f382851598fc6c70b6cbc47839e76eb863644ffb [^]
2017-03-22 15:52hgbotCheckin
2017-03-22 15:52hgbotNote Added: 0095506
2017-03-22 15:56markmm82Review Assigned To => markmm82
2017-03-22 15:56markmm82Note Added: 0095508
2017-03-22 15:56markmm82Statusresolved => closed
2017-03-22 16:42markmm82Relationship addedrelated to 0035600
2017-03-24 14:18ngarciaNote Added: 0095561
2017-03-24 14:18ngarciaStatusclosed => new
2017-03-24 14:18ngarciaResolutionfixed => open
2017-03-24 14:27ngarciaIssue cloned0035616
2017-03-24 14:28ngarciaRelationship addedblocks 0035616
2017-03-24 14:29ngarciaStatusnew => scheduled
2017-03-24 14:29ngarciaStatusscheduled => resolved
2017-03-24 14:29ngarciaResolutionopen => fixed
2017-03-24 14:30ngarciaNote Added: 0095562
2017-03-24 14:30ngarciaStatusresolved => closed

Notes
(0095379)
aferraz   
2017-03-17 14:33   
Test plan:

As group admin role:
   Apply the module's dataset in F&B US Inc.
   Set the Enable Stock Reservations preference to Y
   Log out and log in

   Create a new product in F&B US Inc.
   Receive the following units of it:
      - 40 units in WC-0-0-0
      - 40 units in WC-1-0-0
      - 40 units in WC-2-0-0
   Create a sales order of 100 units of the product
   Generate Picking List from it
   Delete the lines in bins WC-1-0-0 and WC-2-0-0
   Edit the line in bin WC-0-0-0 and reduce the quantity to 5
   Process it
   Generate a new Picking List from the order
   Cancel it
   The reserved quantity of the stock reservation with a released quantity of 5 is updated to 5.
   
   Generate a new Picking List from the order
   Delete the line with WC-2-0-0 bin
   The reservation is removed.

   Click on Edit Lines, select the previously deleted line and add 20 units
   Check a reservation line of 20 units has been made.

   Delete the line again
   Cancel the picking list.
   Check the stock reservations for WC-1-0-0 and WC-2-0-0 bins are removed. The only one pending is the stock reservation with quantity = released quantity = 5 for WC-0-0-0 bin.
(0095487)
markmm82   
2017-03-21 19:08   
(edited on: 2017-03-21 19:09)
Test case settings
As group admin role:
   Apply the module's dataset in F&B US Inc.
   Set the Enable Stock Reservations preference to Y
   Log out and log in


Test plan 1:
As group admin role:
   Go to Product window and create a new one for F&B US Inc org.
      Add a sales price list to it.
   Go to Goods Receipt window and receive the following units of it, select US West coast warehouse:
      - 40 units in WC-0-0-0
      - 40 units in WC-1-0-0
      - 40 units in WC-2-0-0
   Go to Sales Order window and create a new one for F&B US Inc org and US West coast warehouse.
      Add a line of 100 units of the product and book the order.
   Generate Picking List from it.
   Go to Warehouse Picking List window and select previously created Picking List.
   Delete the lines in bins WC-1-0-0 (Quantity 40) and WC-2-0-0 (Quantity 20)
   Edit the line in bin WC-0-0-0 and reduce the quantity to 5
   Process it
   Go to Reserved Stock tab of the Order and notice that only the line related to WC-0-0-0 remains and Quantity = Released = 5. This is correct.
   Generate a new Picking List from the order.
   Notice reserved stock of the order:
      Line 1, WC-0-0-0 Quantity = 40, Released = 5
      Line 2, WC-1-0-0 Quantity = 40, Released = 0
      Line 3, WC-2-0-0 Quantity = 20, Released = 0
   Go to the generated PL and Cancel it
   Go back to Reserved Stock tab of the Order and notice that only the line related to WC-0-0-0 remains and Quantity = Released = 5. This is correct.
   
   Generate a new Picking List from the order.
   Go to the generated PL and notice:
      Line 1, WC-0-0-0 Movement Quantity = 35 (Because of previously released = 5)
      Line 2, WC-1-0-0 Movement Quantity = 40
      Line 3, WC-2-0-0 Movement Quantity = 20
   Delete the line with WC-2-0-0 bin
   The reservation is removed from the Order on this bin. This is correct
   Click on Edit Lines, select the previously deleted line and add 20 units
   Check a reservation line of 20 units has been made without no released quantity. This is correct
   Delete the line again
   Notice the reservation is removed from the Order on this bin. This is correct
   Cancel the picking list.
   Check the reservation is removed and notice that only the line related to WC-0-0-0 remains and Quantity = Released = 5. This is correct.

Test plan 2 (Related issue 29169)
1- Go to Sales order window and create a new header.
2- Go to lines tab and create a new one selecting a product with stock, for example Cerveza Ale
3- Book the order and then click on Generate Picking List button. Complete the process. A new goods shipment and reservation will be also created.
4- Go to Goods Shipment window and create a new record
5- Click on Create Lines From button and select the sales order. Complete the process selecting a storage bin.
6- Complete the shipment.
7- Go to Warehouse Picking List window and select previously created record.
8- Go to lines tab and click on Delete Line button
9- The line now will is deleted, also the shipment associated with the picking list is also deleted.
10- Repeat steps 1-3
11- Go to Goods Shipment window and select record created during last picking list generation.
12- Complete this shipment.
13- Go to Warehouse Picking List window and select created record during last picking list generation.
14- Go to lines tab and click on Delete Line button
    Notice the popup is not opened and an "org.openbravo.base.exception.OBException: OBWPL_ErrorDeletingLine" exception is shown inside the eclipse console. The expected was:
15- An error message will be properly shown as this picking list is related to a shipment completed.


Test plan 3 (Related issue 32651)
As group admin role:
   Create a sales order with a product with stock. Set a quantity with decimals such as 4.5
   Book it
   Generate Picking List from it
   Go to Warehouse Picking List window and cancel it
   Go to Stock Reservation window and check the reservation has been deleted.


Test plan 4 (Related issue 29966)
  Create a Sales order with a line of qty 10 for a product with stock.
  Click on Generate Picking List:
    Picking List type: "Direct Picking List to Customer"
    Grouping Criteria: "Not group"
  Click OK.
  Go to Goods Shipment window.
  Create a Header for the same Business Partner as Sales Order previously created.
  Click on "Create Lines From"
    Select previous sales order and any storage bin.
    Select the line.
  Click OK.
  In Lines edit the created line and set movement qty 5.
  Complete the shipment.
  Go to Warehouse Picking List window.
  Select the previously created Picking List.
  Cancel it.
  The process is done correctly without any exception and i you go to the Reserved stock tab of the order you will see:
    Line 1, Rn-0-0-0 Quantity = 10, Released = 5 (shiped in the created Goods Shipment). It is Ok.

(0095505)
hgbot   
2017-03-22 15:52   
Repository: erp/pmods/org.openbravo.warehouse.pickinglist
Changeset: f382851598fc6c70b6cbc47839e76eb863644ffb
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Mar 17 13:46:13 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.warehouse.pickinglist/rev/f382851598fc6c70b6cbc47839e76eb863644ffb [^]

Fixes issue 35542: Wrong stock reservation when deleting or canceling picking

When cancelling a Warehouse Picking List, compare each shipment line quantity with the related reservation stock quantity - released quantity, instead of just reservation stock quantity, as released quantity will belong to a different shipment.
When deleting a Warehouse Picking List line, substract the reservation stock released quantity to the shipment line quantity, instead of the reservation released quantity, as reservation released quantity could belong to a different reservation stock.
When deleting a Warehouse Picking List line, refresh reservation stock before checking if we need to remove it, as we were not deleting it when it had zero quantity.

---
M src/org/openbravo/warehouse/pickinglist/PickingListActionHandler.java
M src/org/openbravo/warehouse/pickinglist/actionhandler/DeletePickingLineHandler.java
---
(0095506)
hgbot   
2017-03-22 15:52   
Repository: erp/pmods/org.openbravo.warehouse.pickinglist
Changeset: 0dbc109f4bbb353910e7c4e19f79a1cf733234c9
Author: Mark <markmm82 <at> gmail.com>
Date: Wed Mar 22 10:46:14 2017 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.warehouse.pickinglist/rev/0dbc109f4bbb353910e7c4e19f79a1cf733234c9 [^]

Related to issue 35542: Update module version

---
M src-db/database/sourcedata/AD_MODULE.xml
---
(0095508)
markmm82   
2017-03-22 15:56   
Code review + Testing OK
Fixed in version 1.4.1300 of Warehouse Picking List module
(0095561)
ngarcia   
2017-03-24 14:18   
The following case is still failing:

As group admin role:
   Apply the module's dataset in F&B US Inc.
   Set the Enable Stock Reservations preference to Y
   Log out and log in

   Create a new product in F&B US Inc.
   Receive the following units of it:
      - 40 units in WC-0-0-0
      - 40 units in WC-1-0-0
      - 40 units in WC-2-0-0
   Create a sales order of 100 units of the product
   Generate Picking List from it
   Delete the lines in bins WC-1-0-0 and WC-2-0-0
   Edit the line in bin WC-0-0-0 and reduce the quantity to 5
   Process it
   Generate a new Picking List from the order
   Delete the line from the WC-0-0-0 bin
   Check the stock reservation line has:
      Quantity: 10
      Released: 5
(0095562)
ngarcia   
2017-03-24 14:30   
Opened 35616 ticket in order to manage this last situation