Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035831Openbravo ERP03. Procurement managementpublic2017-04-25 13:212017-05-29 17:43
ngarcia 
collazoandy4 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q3 
aferraz
Core
No
0035831: Cannot deactivate a product if it was included in a Return To Vendor Shipment
Cannot deactivate a product if it was included in a Return To Vendor Shipment

The qtyreserved column of the m_storage_pending table is wrongly updated and the ActivePOSO error message is raised in the M_PRODUCT_TRG trigger
As group admin role:
   Create a new product and add a purchase price to it
   Add it to a purchase order and book it
   Check through database the qtyordered column of m_storage_pending is increased with the quantity included in the order. This is correct
   Create a goods receipt from the order
   Check through database the qtyordered column of m_storage_pending is decreased with the quantity included in the goods receipt. This is correct
   Create a Return to Vendor and select the previously created goods receipt
   Check through database the qtyordered column of m_storage_pending is decreased with the quantity included in the return order. This is correct
   Create the Return to Vendor Shipment from the return order
   Check through database the qtyordered column of m_storage_pending is increased with the quantity included in the return shipment. This is correct
   Check through database the qtyreserved column of m_storage_pending is increased with the quantity included in the return shipment. This is NOT correct (qtyreserved belongs to the sales flow)

   Leave the stock of the product to 0 in case it is not
   Go to Product window, set Active = 'N' and check the following error is shown:

   There are pending document lines associated with product. Reactivate them prior to update product.
No tags attached.
related to defect 0031833 closed aferraz Inconsistent data in M_STORAGE_PENDING table if the product is changed from Not Stocked to Stocked having pending orders 
Issue History
2017-04-25 13:21ngarciaNew Issue
2017-04-25 13:21ngarciaAssigned To => Triage Finance
2017-04-25 13:21ngarciaModules => Core
2017-04-25 13:21ngarciaResolution time => 1494885600
2017-04-25 13:21ngarciaTriggers an Emergency Pack => No
2017-04-25 13:21ngarciaIssue Monitored: networkb
2017-04-25 13:24ngarciaRelationship addedrelated to 0031833
2017-04-25 14:29aferrazAssigned ToTriage Finance => collazoandy4
2017-04-25 20:40collazoandy4Statusnew => scheduled
2017-05-02 15:05collazoandy4Note Added: 0096314
2017-05-04 16:01hgbotCheckin
2017-05-04 16:01hgbotNote Added: 0096389
2017-05-04 16:01hgbotStatusscheduled => resolved
2017-05-04 16:01hgbotResolutionopen => fixed
2017-05-04 16:01hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7c5936cbf166f84f091042849b13a41630008cd8 [^]
2017-05-04 16:01hgbotCheckin
2017-05-04 16:01hgbotNote Added: 0096390
2017-05-04 16:02aferrazReview Assigned To => aferraz
2017-05-04 16:02aferrazNote Added: 0096391
2017-05-04 16:02aferrazStatusresolved => closed
2017-05-04 16:02aferrazFixed in Version => 3.0PR17Q3
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096941
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096942

Notes
(0096314)
collazoandy4   
2017-05-02 15:05   
Test Plan
  As group admin role:
   Go to Product window and create a new record:
     Search Key/Name: Product
     Create a new record in Price tab:
       Price List Version: Tarifa Bebidas Alegres
       Unit/List price: 8
   Go to Purchase Order window and create a new record:
     Business Partner: Bebidas Alegres, S.L.
     Create a new record in Lines tab:
       Product: Product
       Ordered Quantity: 10
     Book the order
   Check through database the qtyordered column of m_storage_pending is 10
   Go to Goods Receipt window and create a new record:
     Business Partner: Bebidas Alegres, S.L.
     Select the previous order created in Create lines from option
     Complete the receipt
   Check through database the qtyordered column of m_storage_pending is 0
   Go to Return to vendor window and create a new record:
     Business Partner: Bebidas Alegres, S.L.
     Select the previous receipt in Pick/Edit option
       returnedqty: 10
     Book it
   Check through database the qtyordered column of m_storage_pending is -10
   Go to Return to vendor shipment window and create a new record:
     Business Partner: Bebidas Alegres, S.L.
     Select the previous return to vendor in Pick/Edit option
   Check through database the qtyordered and qtyreserved columns of m_storage_pending are 0
   Go to Product window and edit the previous product created:
    Active = 'N'
    Save it and check no error is shown


   Test Plan II

   Go to Product window and create a new record:
    Search Key/Name: Product2
    Create a new record in Price tab:
      Price List Version: Tarifa de ventas
      Unit/List price: 9
   Go to Physical Inventory window and create a new record:
     In Lines tab create a new record:
       Product: Product2
       Quantity Count: 10
     Clic on Process Inventory count
   Go to Sales Order window and create a new record:
     Business Partner: Alimentos y Supermercados, S.A
     Create a new record in Lines tab:
       Product: Product2
       Ordered Quantity: 10
     Book the order
   Check through database the qtyreserved column of m_storage_pending is increased in 10
   Go to Goods Shipment window and create a new record:
     Business Partner: Alimentos y Supermercados, S.A
     Select the previous order created in Create lines from option
     Complete the shipment
   Check through database the qtyreserved column of m_storage_pending is 0
   Go to Return From Customer window and create a new record:
     Business Partner: Alimentos y Supermercados, S.A
     Select the previous shipment in Pick/Edit option
       returnedqty: 10
     Book it
   Check through database the qtyreserved column of m_storage_pending is -10
   Go to Return Material Receipt window and create a new record:
     Business Partner: Alimentos y Supermercados, S.A
     Select the previous return from customer in Pick/Edit option
   Check through database the qtyordered and qtyreserved columns of m_storage_pending are 0
(0096389)
hgbot   
2017-05-04 16:01   
Repository: erp/devel/pi
Changeset: 7c5936cbf166f84f091042849b13a41630008cd8
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Mon May 01 23:52:02 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/7c5936cbf166f84f091042849b13a41630008cd8 [^]

Fixes issue 35831: Cannot deactivate a product included in a RTV Shipment

The qtyreserved column of the m_storage_pending table is wrongly updated in the
Return To Vendor Shipment process because the M_UPDATE_STORAGE_PENDING call in
c_orderline2_trg trigger doesn't take into account if the order isSOTrx.

Now the M_UPDATE_STORAGE_PENDING call in the trigger check if the order isSOTrx
to set the correct value of qtyreserved arg.

---
M src-db/database/model/triggers/C_ORDERLINE2_TRG.xml
---
(0096390)
hgbot   
2017-05-04 16:01   
Repository: erp/devel/pi
Changeset: d46184b8539b0eaa2a23cc49e91dcdf2f8199b55
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu May 04 14:44:04 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d46184b8539b0eaa2a23cc49e91dcdf2f8199b55 [^]

Related to issue 35831: Code review improvements

---
M src-db/database/model/triggers/C_ORDERLINE2_TRG.xml
---
(0096391)
aferraz   
2017-05-04 16:02   
Code review + Testing OK
(0096941)
hudsonbot   
2017-05-29 17:43   
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/1ee70113bdc4 [^]
Maturity status: Test
(0096942)
hudsonbot   
2017-05-29 17:43   
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/1ee70113bdc4 [^]
Maturity status: Test