Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032078Openbravo ERP04. Warehouse managementpublic2016-02-01 17:132016-03-17 10:56
aferraz 
aferraz 
normalmajoralways
closedfixed 
5
 
3.0PR16Q2 
dmiguelez
Core
Packaging and release
2015-12-04
main
https://code.openbravo.com/erp/devel/pi/rev/e32a6dfe59e6 [^]
No
0032078: Reserved quantity is not correct under certain circumstances
Reserved quantity is not correct under certain circumstances.
Reservations are disabled by default. To be able to use them please insert a new Preference using property Enable Stock Reservations with value Y.
http://wiki.openbravo.com/wiki/Stock_Reservation [^] [^]

As group Admin role,
Go to Physical inventory and remove the stock for Cerveza Lager. Keep 700 units in Warehouse España Región Norte 0-0-0
Go to Sales Order window,
  Org: España
Lines:
 Cerveza Lager: qty: 900
 Stock Reservation: blank
Book it.
Once you select the line, you will see Manage Reservations button. Click on it, and indicate you would like to reserve 400 units. Click on Done.

Go to Stock reservation window.
Realize that the register created indicates 900 units, but the user said 400. That is wrong.

If you "Manage Stock" again from the Stock Reservation window, and you indicate 400, now the "Reserved Qty" has the correct quantity that is 400.
No tags attached.
related to design defect 00280513.0PR15Q2 closed umartirena Reserved quantity is not correct under certain circumstancies 
related to defect 00318763.0PR16Q2 closed aferraz Cannot void a goods shipment if two lines are related with the same sales order line which is reserved and released 
depends on backport 00320983.0PR16Q1 closed aferraz Reserved quantity is not correct under certain circumstances 
caused by defect 0031514 closed markmm82 Prereservation from Sales Order window is created in Completed status if there is available stock and in Draft if there is not 
related to defect 0033752 closed markmm82 Cannot close an order if the stock was reserved and the associated goods shipment is voided 
blocks defect 0032089 closed aferraz Product with stock in second UOM is automatically reserved but it is not possible to reserve it manually 
Issue History
2016-02-01 17:13aferrazNew Issue
2016-02-01 17:13aferrazAssigned To => Triage Finance
2016-02-01 17:13aferrazModules => Core
2016-02-01 17:13aferrazRegression level => Packaging and release
2016-02-01 17:13aferrazRegression date => 2015-12-04
2016-02-01 17:13aferrazRegression introduced in release => main
2016-02-01 17:13aferrazRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/e32a6dfe59e6 [^]
2016-02-01 17:13aferrazTriggers an Emergency Pack => No
2016-02-01 17:14aferrazRelationship addedcaused by 0031514
2016-02-01 17:14aferrazRelationship addedrelated to 0028051
2016-02-02 13:26aferrazRelationship addedrelated to 0031876
2016-02-02 14:34aferrazNote Added: 0083850
2016-02-02 14:38aferrazNote Added: 0083851
2016-02-02 17:13aferrazNote Added: 0083858
2016-02-02 17:13aferrazNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r10857
2016-02-02 17:14aferrazStatusnew => scheduled
2016-02-02 17:14aferrazAssigned ToTriage Finance => aferraz
2016-02-03 10:04psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10868#r10868
2016-02-03 10:05psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=10869#r10869
2016-02-03 10:08psanjuanNote Added: 0083885
2016-02-03 10:32psanjuanNote Edited: 0083850bug_revision_view_page.php?bugnote_id=0083850#r10871
2016-02-03 14:35psanjuanNote Edited: 0083850bug_revision_view_page.php?bugnote_id=0083850#r10876
2016-02-03 14:36psanjuanNote Edited: 0083850bug_revision_view_page.php?bugnote_id=0083850#r10877
2016-02-03 14:37psanjuanNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r10878
2016-02-03 15:21psanjuanNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r10879
2016-02-03 15:24psanjuanNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r10880
2016-02-03 15:29psanjuanNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r10884
2016-02-03 15:30psanjuanNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r10885
2016-02-03 15:31psanjuanNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r10886
2016-02-03 15:32psanjuanNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r10887
2016-02-03 15:33psanjuanNote Edited: 0083858bug_revision_view_page.php?bugnote_id=0083858#r10889
2016-02-03 15:36psanjuanNote Edited: 0083858bug_revision_view_page.php?bugnote_id=0083858#r10890
2016-02-03 15:43psanjuanNote Added: 0083898
2016-02-04 09:17psanjuanNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r10895
2016-02-04 09:19psanjuanNote Edited: 0083898bug_revision_view_page.php?bugnote_id=0083898#r10897
2016-02-04 10:09psanjuanNote Edited: 0083898bug_revision_view_page.php?bugnote_id=0083898#r10909
2016-02-05 11:40aferrazRelationship addedrelated to 0032089
2016-02-05 13:20aferrazRelationship deletedrelated to 0032089
2016-02-05 13:20aferrazRelationship addedblocks 0032089
2016-02-05 13:35hgbotCheckin
2016-02-05 13:35hgbotNote Added: 0083970
2016-02-05 13:35hgbotStatusscheduled => resolved
2016-02-05 13:35hgbotResolutionopen => fixed
2016-02-05 13:35hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/acc489e2a1839a10a53a3302b96b248ec4e13f5b [^]
2016-02-05 13:36dmiguelezReview Assigned To => dmiguelez
2016-02-05 13:36dmiguelezNote Added: 0083973
2016-02-05 13:36dmiguelezStatusresolved => closed
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085109
2016-08-20 21:54aferrazRelationship addedrelated to 0033752
2018-07-19 11:51AtulOpenbravoNote Edited: 0083851bug_revision_view_page.php?bugnote_id=0083851#r17432

Notes
(0083850)
aferraz   
2016-02-02 14:34   
(edited on: 2016-02-03 14:36)
Test plan I:

As group admin role:
   Create the Enable Stock Reservations preference
Log out and log in
   Create a product for España named "32078 A"
   Add a price list for "Tarifa de Bebidas Alegres" and "Tarifa de ventas" .
   Create a receipt for created product with qty=10 in RN-0-0-0 locator.
   Create a sales order, add the previously created product and qty=10. Complete it.

   Add a reservation to it of qty=7 in RN-0-0-0.
   Realize a stock reservation has been created with qty=10, reserved qty=7, released=0 and a line with qty=7 released=0 in RN-0-0-0.

   Create another receipt for the same product.
   This time received 100 units in the storage bin RN-1-0-0. Complete it.
   Create a sales order, add previously created product and qty = 50.
Complete it.
   Add reservation to it of qty=50 from RN-1-0-0.
   Realize that a new stock reservation has been created with qty = 50, Reserved qty= 50

(0083851)
aferraz   
2016-02-02 14:38   
(edited on: 2018-07-19 11:51)
Test plan II:

As group admin role:
   Create the Enable Stock Reservations preference
   Log out and log in
   Create a product for España named "32078 B"
   Add a price list for "Tarifa de Bebidas Alegres" and "Tarifa de ventas".
   Create a Purchase Order for that product and qty=10. Book it.
   Create a Sales Order for the same product and qty=10. Book it.
   Go to the line, click on Manage Reservation button and select the purchase order line and enter 10 in the column Quantity.
   Realize a stock reservation has been created with qty=10, reserved qty=10, released=0 and a line related with purchase order line with qty=10 and released=0.

  Create another Purchase Order for that product and qty=100. Book it.
   Create a Sales Order for the same product and qty=90. Book it.
   Go to the line, click on Manage Reservation button and select the purchase order line and enter 50 in the column Quantity.
   Realize a stock reservation has been created with qty=90, reserved qty=50, released=0.

   Create a Goods Receipt from the purchase order, receipt all 100 units in storage bin RN-1-0-0.Complete it.

   Create a Goods Shipment fro the sales order, to ship 90 units from the storage bin RN-1-0-0. Complete it.

  Go to the Stock reservation and verify it has changed as below:
- Quantity = 90
- Reserved Qty = 50
- Released = 50

(0083858)
aferraz   
2016-02-02 17:13   
(edited on: 2016-02-03 15:36)
Test plan III:

As group admin role:
   Create the Enable Stock Reservations preference
   Log out and log in
   Create a product for España, named "32078 C".
   Add a price list for "Tarifa de Bebidas Alegres" and "Tarifa de ventas".
   Create a Goods Receipt for that product and qty=10 in RN-0-0-0. Complete it.
   Create a Purchase Order for that product and qty=10. Book it.
   Create a Sales Order for the same product and qty=10. Book it.
   Go to the line, click on Manage Reservation button and select the purchase order line, enter a qty=10
   Realize a stock reservation has been created with qty=10, reserved qty=10, released=0 and a line related with purchase order line with qty=10 and released=0.

Once more:

Create a Goods Receipt for that product and qty=10 in RN-0-0-0. Complete it.
   Create a Purchase Order for that product and qty=20. Book it.
   Create a Sales Order for the same product and qty=10. Book it.
   Go to the line, click on Manage Reservation button and select the purchase order line, enter a qty=10
   Realize a stock reservation has been created with qty=10, reserved qty=10, released=0 and a line related with purchase order line with qty=10 and released=0.

(0083885)
psanjuan   
2016-02-03 10:08   
Issue verified.
(0083898)
psanjuan   
2016-02-03 15:43   
(edited on: 2016-02-04 10:09)
Test Plan above verified.
Issue can be code review and closed.

(0083970)
hgbot   
2016-02-05 13:35   
Repository: erp/devel/pi
Changeset: acc489e2a1839a10a53a3302b96b248ec4e13f5b
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Feb 05 11:37:39 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/acc489e2a1839a10a53a3302b96b248ec4e13f5b [^]

Fixes issue 32078: Reserved quantity is not correct

In ManageReservationActionHandler, when clicking Done in Manage Reservation P&E, it was first reserving what the user was typing in the P&E, and if it was not processed the reservation, it was processing it. As the M_RESERVATION_POST tries always to reserve as much as possible, it was overriding the previously set amounts. In order to prevent this, now first the reservation is being processed and after that the values typed in the UI are being set to the reservation.
In case no stock reservation is created by m_reservation_post when processing the reservation, res_status will be Draft. To be sure reservation is set as completed, force status after call ReservationUtils.processReserve method.
Reservation will only be kept as draft in case it has no lines after execute manageReservedStockLines.

---
M src/org/openbravo/common/actionhandler/ManageReservationActionHandler.java
---
(0083973)
dmiguelez   
2016-02-05 13:36   
Code Review + Testing Ok
(0085109)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test