Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031813Openbravo ERP04. Warehouse managementpublic2015-12-30 13:282016-01-07 17:49
ngarcia 
aferraz 
immediatemajoralways
closedfixed 
5
 
3.0PR15Q4.2 
dmiguelez
Core
Production - QA Approved
2015-06-22
3.0PR15Q4
https://code.openbravo.com/erp/devel/pi/rev/e03c1808e1952c20ef838c8a8b976cff802d5156 [^]
No
0031813: Cannot void a goods shipment if it has more than one closed reservation associated
Cannot void a goods shipment if it has more than one closed reservation associated
As group admin role:
   Set the Enable Stock Reservations preference to Y
   Log out and log in
   Create a Sales Order, add two products with stock to it and book it
   Select each lines and create a reservation for them (Manage Reservations)
   Go to Goods Shipment window, create a header and select the previously created sales order lines and complete it
   Check the two Stock Reservation status is updated to Closed
   Try to void the Goods Shipment and check the following error message is raised:
      Internal Error: Duplicate primary key/uuid. Your record has not been saved into the table Stock Reservation
In the M_INOUT_POST database function, more than one record is being inserted in the M_RESERVATION table with the same m_reservation_id (v_uuid)
No tags attached.
blocks defect 00317993.0PR16Q2 closed aferraz Cannot void a goods shipment if it has more than one closed reservation associated 
Issue History
2016-01-04 11:28aferrazTypedefect => backport
2016-01-04 11:28aferrazTarget Version => 3.0PR15Q4.2
2016-01-07 17:48hgbotCheckin
2016-01-07 17:48hgbotNote Added: 0083165
2016-01-07 17:48hgbotStatusscheduled => resolved
2016-01-07 17:48hgbotResolutionopen => fixed
2016-01-07 17:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q4.2/rev/69f3a1a1c22d00eec6c5bec8cb1dd3c4f0c766e9 [^]
2016-01-07 17:48hgbotCheckin
2016-01-07 17:48hgbotNote Added: 0083166
2016-01-07 17:48hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/backports/3.0PR15Q4.2/rev/69f3a1a1c22d00eec6c5bec8cb1dd3c4f0c766e9 [^] => http://code.openbravo.com/erp/backports/3.0PR16Q1/rev/ef895ced13c2d31e6857ff3197de81c79e5629b5 [^]
2016-01-07 17:49dmiguelezReview Assigned To => dmiguelez
2016-01-07 17:49dmiguelezNote Added: 0083167
2016-01-07 17:49dmiguelezStatusresolved => closed

Notes
(0083165)
hgbot   
2016-01-07 17:48   
Repository: erp/backports/3.0PR15Q4.2
Changeset: 69f3a1a1c22d00eec6c5bec8cb1dd3c4f0c766e9
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Jan 04 19:14:21 2016 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR15Q4.2/rev/69f3a1a1c22d00eec6c5bec8cb1dd3c4f0c766e9 [^]

Fixes issue 31813: Cannot void GoodsShipment if it has reservation associated

Generate uuid inside the loop to avoid create more than one M_Reservation with the same M_Reservation_ID in M_INOUT_POST.
Format code properly ("Add a reservation stock with the ordered quantity" section) in M_INOUT_POST.
Remove duplicated variable v_reservedqty in M_RESERVATION_POST to avoid set wrong Reservation Status to Order Line.
Take into account only Order Lines with qtyordered > 0 and with product of stocked and item type when setting Reservation Status to Order in M_RESERVATION_POST.
Set "Completely Reserved" reservation status to Order Line also when reservedqty > quantity in M_RESERVATION_POST and M_RESERVATION_TRG.

---
M src-db/database/model/functions/M_INOUT_POST.xml
M src-db/database/model/functions/M_RESERVATION_POST.xml
M src-db/database/model/triggers/M_RESERVATION_TRG.xml
---
(0083166)
hgbot   
2016-01-07 17:48   
Repository: erp/backports/3.0PR16Q1
Changeset: ef895ced13c2d31e6857ff3197de81c79e5629b5
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Jan 04 19:14:21 2016 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR16Q1/rev/ef895ced13c2d31e6857ff3197de81c79e5629b5 [^]

Fixes issue 31813: Cannot void GoodsShipment if it has reservation associated

Generate uuid inside the loop to avoid create more than one M_Reservation with the same M_Reservation_ID in M_INOUT_POST.
Format code properly ("Add a reservation stock with the ordered quantity" section) in M_INOUT_POST.
Remove duplicated variable v_reservedqty in M_RESERVATION_POST to avoid set wrong Reservation Status to Order Line.
Take into account only Order Lines with qtyordered > 0 and with product of stocked and item type when setting Reservation Status to Order in M_RESERVATION_POST.
Set "Completely Reserved" reservation status to Order Line also when reservedqty > quantity in M_RESERVATION_POST and M_RESERVATION_TRG.

---
M src-db/database/model/functions/M_INOUT_POST.xml
M src-db/database/model/functions/M_RESERVATION_POST.xml
M src-db/database/model/triggers/M_RESERVATION_TRG.xml
---
(0083167)
dmiguelez   
2016-01-07 17:49   
Code Review + Testing Ok