Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035330Openbravo ERP04. Warehouse managementpublic2017-02-21 16:482017-03-15 20:19
ngarcia 
collazoandy4 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q2 
markmm82
Core
No
0035330: [Negative Stock Correction]: Warehouse is not taken into account to check if stock was negative previous to an stock increase
[Negative Stock Correction]: Warehouse is not taken into account to check if stock was negative previous to an stock increase.

The problem is that when calling the getStockOnTransactionDate and getValuedStockOnTransactionDate functions in CostingServer class, a new CostingAlgorithm is being created and its costDimensions are null
As group admin role:
   Set the Enable Negative Stock Corrections preference to Y
   Select the Allow negative stock option at Client level
   Validate a Costing Rule in F&B España S.A. with warehouse dimension selected
   Create a new product
   Create a purchase order
   Add 10 units of the previously created product with a price of 5
   Create the goods receipt in España Region Norte warehouse from it
   Create a purchase order
   Add 10 units of the previously created product with a price of 5
   Create the goods receipt in España Region Sur warehouse from it
   Create the goods shipment of 15 units in España Region Norte warehouse
   Create a purchase order
   Add 10 units of the previously created product with a price of 2
   Create the goods receipt in España Region Norte warehouse from it
   Launch the Costing Background process and check it finishes successfully
   Check the new entry in Costing tab for Region Norte warehouse is negative because a negative stock correction was not done and it should have be done
Set costingAlgorithm variable as a global variable inside CostingServer class.
Call CostingAlgorithm.init() method only inside getCostingAlgorithm() method.
Call getCostingAlgorithm() method only inside CostingServer.init() method.
Thus, new CostingAlgorithm instances will only be created and initialized when creating a new CostingServer instance.
No tags attached.
related to design defect 0036758 new Triage Omni WMS After validating a costing rule with warehouse dimension, remaining stock valuation could exist on each warehouse but not global 
blocks defect 0035337 closed collazoandy4 [Negative Stock Correction]: Costing Background Process finishes with error if Warehouse dimension is selected in costing rule 
Issue History
2017-02-21 16:48ngarciaNew Issue
2017-02-21 16:48ngarciaAssigned To => Triage Finance
2017-02-21 16:48ngarciaModules => Core
2017-02-21 16:48ngarciaResolution time => 1489446000
2017-02-21 16:48ngarciaTriggers an Emergency Pack => No
2017-02-21 16:49ngarciaDescription Updatedbug_revision_view_page.php?rev_id=14656#r14656
2017-02-21 16:49ngarciaIssue Monitored: networkb
2017-02-21 16:56ngarciaProposed Solution updated
2017-02-21 17:03ngarciaResolution time1489446000 => 1488236400
2017-02-22 12:07ngarciaRelationship addedblocks 0035337
2017-02-22 12:15ngarciaNote Added: 0094531
2017-02-22 15:55egoitzIssue Monitored: egoitz
2017-02-22 17:12markmm82Assigned ToTriage Finance => collazoandy4
2017-02-23 14:27aferrazProposed Solution updated
2017-02-23 18:21hgbotCheckin
2017-02-23 18:21hgbotNote Added: 0094581
2017-02-23 18:21hgbotStatusnew => resolved
2017-02-23 18:21hgbotResolutionopen => fixed
2017-02-23 18:21hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d202b98c89e82fdbbb614891ef22b27d5e93d6ec [^]
2017-02-23 18:26markmm82Note Added: 0094584
2017-02-23 19:23markmm82Note Deleted: 0094584
2017-02-23 19:23markmm82Review Assigned To => markmm82
2017-02-23 19:23markmm82Note Added: 0094588
2017-02-23 19:23markmm82Statusresolved => closed
2017-02-23 19:23markmm82Fixed in Version => 3.0PR17Q2
2017-03-15 20:19hudsonbotCheckin
2017-03-15 20:19hudsonbotNote Added: 0095226
2017-09-08 14:48aferrazRelationship addedrelated to 0036758

Notes
(0094531)
ngarcia   
2017-02-22 12:14   
Customer data should be corrected
(0094581)
hgbot   
2017-02-23 18:21   
Repository: erp/devel/pi
Changeset: d202b98c89e82fdbbb614891ef22b27d5e93d6ec
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Feb 23 12:49:01 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d202b98c89e82fdbbb614891ef22b27d5e93d6ec [^]

Fixes issue 35330: CostingAlgorithm not properly initialized

Set costingAlgorithm variable as a global variable inside CostingServer class.
Call CostingAlgorithm.init() method only inside getCostingAlgorithm() method.
Call getCostingAlgorithm() method only inside CostingServer.init() method.
Thus, new CostingAlgorithm instances will only be created and initialized when creating a new CostingServer instance.

---
M src/org/openbravo/costing/CostingServer.java
---
(0094588)
markmm82   
2017-02-23 19:23   
Code review + Testing OK
(0095226)
hudsonbot   
2017-03-15 20:19   
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/54e102bef53e [^]
Maturity status: Test