Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035270Openbravo ERP04. Warehouse managementpublic2017-02-15 11:312017-03-30 00:04
ngarcia 
collazoandy4 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q2 
aferraz
Core
No
0035270: Wrong reservation when closing a sales order with a voided partial shipment
Wrong reservation when closing a sales order with a voided partial shipment.

A reserved quantity remains against a sales order that is not pending to be shipped (M_STORAGE_DETAIL.RESERVEDQTY)
As group admin role:
   Set the Enable Stock Reservations preference to Y
   Log out and log in
   Create a Sales Order
   Add 10 units of a product with stock to it
   Book it
   Click on Manage Reservation and reserve the 10 units
   Create a goods shipment from the sales order line but only for 6 units
   Create a goods shipment from the sales order line but the pending 4 units
   Void this last shipment
   Close the Sales order

   Two closed reservations remain against the order line:
      1. Quantity: 10
         Reserved Qty: 6
         Released: 10
      2. Quantity: 6
         Reserved Qty: 4
         Released: 0
Change the behaviour when voiding a goods shipment: instead of closing the reservation and creating a new one, update the released quantity in the available one as having released reservations against not shipped sales order lines is confusing
No tags attached.
related to defect 0028645 closed vmromanos Openbravo ERP It would be nice to be able to reserve more qty than the qty of the order if you have defined the 'is qty variable' 
related to defect 00243533.0MP26 closed caristu Openbravo ERP Closing sales order does not adjust associated stock reservation when final quantity is zero 
related to defect 0026831 closed AtulOpenbravo Modules Sales order shows Reservation Status as Partially Reserved. Whereas no reservation is present against particular order. 
related to defect 0032390 closed markmm82 Openbravo ERP Cannot close an order with an allocated reservation if the released quantity is smaller than half the total reserved quantity 
related to defect 0033752 closed markmm82 Openbravo ERP Cannot close an order if the stock was reserved and the associated goods shipment is voided 
related to defect 0033837 closed markmm82 Openbravo ERP Reservation Status info is not correct if an order including a reserved product is closed. 
has duplicate defect 0035387 closed Triage Omni WMS Openbravo ERP Wrong reserved value when closing a sales order with a partial shipment voided 
related to defect 0035958 closed collazoandy4 Openbravo ERP Reactivating a sales order and decreasing the ordered quantity that is already reserved causes wrong reservation 
Issue History
2017-02-15 11:31ngarciaNew Issue
2017-02-15 11:31ngarciaAssigned To => Triage Finance
2017-02-15 11:31ngarciaModules => Core
2017-02-15 11:31ngarciaTriggers an Emergency Pack => No
2017-02-15 11:31ngarciaIssue Monitored: networkb
2017-02-15 11:32ngarciaRelationship addedrelated to 0028645
2017-02-28 18:29ngarciaRelationship addedhas duplicate 0035387
2017-02-28 18:37ngarciaResolution time => 1490050800
2017-02-28 18:37ngarciaPriorityhigh => urgent
2017-02-28 18:37ngarciaSeverityminor => major
2017-02-28 18:37ngarciaDescription Updatedbug_revision_view_page.php?rev_id=14707#r14707
2017-02-28 21:02markmm82Assigned ToTriage Finance => collazoandy4
2017-03-07 18:53vmromanosAssigned Tocollazoandy4 => vmromanos
2017-03-07 18:58vmromanosReview Assigned To => vmromanos
2017-03-07 18:58vmromanosNote Added: 0094813
2017-03-07 18:58vmromanosStatusnew => closed
2017-03-07 18:58vmromanosResolutionopen => no change required
2017-03-07 19:06vmromanosNote Edited: 0094813bug_revision_view_page.php?bugnote_id=0094813#r14746
2017-03-08 10:30vmromanosAssigned Tovmromanos => Triage Finance
2017-03-08 10:30vmromanosNote Added: 0094816
2017-03-08 10:30vmromanosStatusclosed => new
2017-03-08 10:30vmromanosResolutionno change required => open
2017-03-12 17:19markmm82Assigned ToTriage Finance => collazoandy4
2017-03-16 19:54collazoandy4Statusnew => scheduled
2017-03-20 16:57jfrancesIssue Monitored: jfrances
2017-03-20 17:34collazoandy4Note Added: 0095431
2017-03-23 09:30aferrazRelationship addedrelated to 0024353
2017-03-23 09:32aferrazRelationship addedrelated to 0026831
2017-03-23 09:33aferrazRelationship addedrelated to 0032390
2017-03-23 09:33aferrazRelationship addedrelated to 0033752
2017-03-23 09:33aferrazRelationship addedrelated to 0033837
2017-03-25 03:00collazoandy4Note Edited: 0095431bug_revision_view_page.php?bugnote_id=0095431#r14884
2017-03-28 18:52collazoandy4Note Edited: 0095431bug_revision_view_page.php?bugnote_id=0095431#r14907
2017-03-29 12:10hgbotCheckin
2017-03-29 12:10hgbotNote Added: 0095634
2017-03-29 12:11hgbotStatusscheduled => resolved
2017-03-29 12:11hgbotResolutionopen => fixed
2017-03-29 12:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/edb969df8c3f00c00716da2fc63d49e21457a81a [^]
2017-03-29 12:11hgbotCheckin
2017-03-29 12:11hgbotNote Added: 0095635
2017-03-29 12:12aferrazReview Assigned Tovmromanos => aferraz
2017-03-29 12:12aferrazNote Added: 0095636
2017-03-29 12:12aferrazStatusresolved => closed
2017-03-29 12:12aferrazFixed in Version => 3.0PR17Q2
2017-03-30 00:04hudsonbotCheckin
2017-03-30 00:04hudsonbotNote Added: 0095684
2017-03-30 00:04hudsonbotCheckin
2017-03-30 00:04hudsonbotNote Added: 0095685
2017-05-24 20:05collazoandy4Relationship addedrelated to 0035958
2018-07-19 12:14AtulOpenbravoNote Edited: 0095431bug_revision_view_page.php?bugnote_id=0095431#r17437
2018-07-19 18:11AtulOpenbravoNote Edited: 0095431bug_revision_view_page.php?bugnote_id=0095431#r17446

Notes
(0094813)
vmromanos   
2017-03-07 18:58   
(edited on: 2017-03-07 19:06)
After following the steps to reproduce the system generates 2 reservations:

* First one in status Closed:
  Reserved Qty = 10
  Released Qty = 10

* Second one in status Completed (note that the steps to reproduce says it was Closed and that's not true)
  Reserved Qty = 4
  Released Qty = 0


So that means the 4 units pending to be shipped are properly reserved.
The first reservation remains as a log of what happened (there was a moment when you released the 10 units) and does not have any impact as the status is Closed.

(0094816)
vmromanos   
2017-03-08 10:30   
Reopened:

The process works fine until the Sales Order is closed. In this moment the last reservation is transformed to Closed but the quantity reserved = 4 and the quantity released = 0.

This is wrong and this last reservation should be deleted instead, because the order is closed and there is no need to keep the reservation.

Besides, the Manage Stock button in Reservation Stock window should be hidden when the reservation is in status closed.
(0095431)
collazoandy4   
2017-03-20 17:34   
(edited on: 2018-07-19 18:11)
As F&B International Group Admin Role:
   Go to Preference windows and create a new record:
     Property: Enable Stock Reservations
     Value: Y
   Log out and log in
   Create a new Sales Order:
     Business Partner: Alimentos y Supermercados, S.A
     Go to Lines tab and create a new Record:
       Product: Vino Blanco 0,75L
       Ordered Quantity: 10
     Clic on Book button
     Select the created line and Click on Manage Reservation and reserve the 10 units
   Create a new Goods Shipment:
     Business Partner: Alimentos y Supermercados, S.A
     Clic on Create Lines From button
       Select the created order
       Warehouse position: Rn-0-0-0
       Select the order line
       Clic on OK button
     Edit the created line Movement Quantity to 6
     Clic on Complete button
   Create a new Goods Shipment:
     Business Partner: Alimentos y Supermercados, S.A
     Clic on Create Lines From button
       Select the created order
       Warehouse position: Rn-0-0-0
       Select the order line
       Clic on OK button
     Clic on Complete button
   Check in Stock Reservation window that the created reservation it's closed and quantity/reserved qty/released = 10
   Void the previous shipment created
   Close the order
   Go to Stock Reservation window and check:
     Manage Stock button doesn't show in closed reservation
     Exist two reservations associated to the order with quantity/reserved qty/released = 10 and quantity = 6, reserved qty/released = 0

Test Plan II
   Go to Product and create a new Record:
     Search Key / Name: Issue 35270
     Go to Price and create a new Record:
       Price List Version: Tarifa de ventas
       Unit Price: 8
   Go to Goods Receipt window and create a new Record:
     Business Partner: Bebidas Alegres, S.L.
     Go to Lines tab and create a new Record:
       Product: Issue 35270
       Movement Quantity: 100
     Complete the receipt
   Create a new Sales Order:
     Business Partner: Alimentos y Supermercados, S.A
     Go to Lines tab and create a new Record:
       Product: Issue 35270
       Ordered Quantity: 10
     Clic on Book button
     Select the created line and Click on Manage Reservation and reserve the 10 units
   Check in Stock Reservation: quantity = 10, reserved quantity = 10, released quantity = 0, status = CO.
   Go to Stock tab of Product window and check: quantity on hand = 100, reserved quantity = 10.
   Create a new Goods Shipment:
     Business Partner: Alimentos y Supermercados, S.A
     Clic on Create Lines From button
       Select the created order
       Warehouse position: Rn-0-0-0
       Select the order line
       Clic on OK button
     Edit the created line Movement Quantity to 6
     Clic on Complete button
   Check in Stock Reservation: quantity = 10, reserved quantity = 10, released quantity = 6, status = CO.
   Go to Stock tab of Product window and check: quantity on hand = 94, reserved quantity = 4.
   Create a new Goods Shipment:
     Business Partner: Alimentos y Supermercados, S.A
     Clic on Create Lines From button
       Select the created order
       Warehouse position: Rn-0-0-0
       Select the order line
       Clic on OK button
     Clic on Complete button
   Check in Stock Reservation window the created reservation it's closed and quantity/reserved qty/released = 10
   Go to Stock tab of Product window and check: quantity on hand = 90, reserved quantity = 0.
   Void the previous shipment created
   Check in Stock Reservation window that a new reservation was created with status = completed, quantity = 10, reserved qty = 4, released = 0
   Go to Stock tab of Product window and check: quantity on hand = 94, reserved quantity = 4.
   Create a new Goods Shipment:
     Business Partner: Alimentos y Supermercados, S.A
     Clic on Create Lines From button
       Select the created order
       Warehouse position: Rn-0-0-0
       Select the order line
       Clic on OK button
     Edit the created line Movement Quantity to 1
     Clic on Complete button
    Check in Stock Reservation window the previous created reservation released qty was updated to 1
    Go to Stock tab of Product window and check: quantity on hand = 93, reserved quantity = 3.
    Close the order
    Check Sales Order: ordered quantity = 7, delivered quantity = 7.
    Check in Stock Reservation window:
      Stock Reservation 1: quantity = 10, reserved quantity = 10, released quantity = 10, status = CL.
      Stock Reservation 2: quantity = 7, reserved quantity = 1, released quantity = 1, status = CL.
    Go to Stock tab of Product window and check: quantity on hand = 93, reserved quantity = 0.

Test Plan III
   Create a new Sales Order:
     Business Partner: Alimentos y Supermercados, S.A
     Go to Lines tab and create a new Record:
       Product: Vino Blanco 0,75L
       Ordered Quantity: 10
     Clic on Book button
     Select the created line and Click on Manage Reservation and reserve the 10 units
   Go to Goods Shipment window and create a new record:
     Business Partner: Alimentos y Supermercados, S.A
     Clic on Create Lines From button
       Select the created order
       Warehouse position: Rn-0-0-0
       Select the order line
       Clic on OK button
     Edit the created line Movement Quantity to 1
     Clic on Complete button
   Check in Stock Reservation window the reservation asociated to the order it's completed with quantity = 10, reserved qty = 10, released = 1
   Close the previous order created
   Check in Stock Reservation window that the previous reservation it's close with quantity/reserved qty/released = 1

Test Plan IV
  Create a new Sales Order window:
     Business Partner: Alimentos y Supermercados, S.A
     Go to Lines tab and create a new Record:
       Product: Vino Blanco 0,75L
       Ordered Quantity: 10
     Clic on Book button
     Select the created line and Click on Manage Reservation and reserve the 10 units
  Check in Stock Reservation window that the reservation asociated to the order have quantity/reserved qty/released = 10
  Void the order
  Check in Stock Reservation window that the reservation asociated to the order have quantity/reserved qty/released = 0

(0095634)
hgbot   
2017-03-29 12:10   
Repository: erp/devel/pi
Changeset: edb969df8c3f00c00716da2fc63d49e21457a81a
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Mar 28 12:37:35 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/edb969df8c3f00c00716da2fc63d49e21457a81a [^]

Fixes issue 35270: Wrong Sales Order reservation with a voided partial shipment

When closing a Sales Order with a reservation that contains a voided partial shipment
The reservation created in the shipment voiding process was keeping associated
to the Sales Order. Also in the Stock Reservation window the Manage Stock button
is show in a reservation with close status.

Now the reservation stock created in the voiding process of the Shipment is deleted
in the close process of the order, also the reservation stock qty = releasedqty
if the order line orderedqty is greater than reservation releasedqty

The display logic of the Manage Stock button now check the selected reservation
status.

---
M src-db/database/model/functions/C_ORDER_POST1.xml
M src-db/database/sourcedata/AD_FIELD.xml
---
(0095635)
hgbot   
2017-03-29 12:11   
Repository: erp/devel/pi
Changeset: aba5b34b8ad7267b56cd32ab972a146845540009
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Mar 29 12:10:01 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/aba5b34b8ad7267b56cd32ab972a146845540009 [^]

Related to issue 35270: Code review improvements

Update related reservation quantity with order line delivered quantity when closing the order.

---
M src-db/database/model/functions/C_ORDER_POST1.xml
---
(0095636)
aferraz   
2017-03-29 12:12   
Code review + Testing OK
(0095684)
hudsonbot   
2017-03-30 00:04   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/8a8b60d9776c [^]
Maturity status: Test
(0095685)
hudsonbot   
2017-03-30 00:04   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/8a8b60d9776c [^]
Maturity status: Test