Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028487Openbravo ERP04. Warehouse managementpublic2014-12-24 14:462015-02-04 20:33
psanjuan 
umartirena 
urgentmajoralways
closedfixed 
20Ubuntu 8.04.1
 
 
Core
No
0028487: Java Lang Null pointer - No cost is being calculated
Java Lang Null pointer - No cost is being calculated
Create a new product in QA Testing Client named "Negativo". Set it as Allow Negative. Enter manually an average cost of 2.72.

Go to Goods Shipment window and create two shipments for that product (which does not have stock).

Go to process request window and run costing background process.

Realize that cost is calculated and the shipments can be posted.

Go to product window and enter a purchase price of 5.00. Create a purchase order of 5 units and receipt those units in a good receipt created from the order.

Complete the receipt.

Go to process request window and launch the costing background process.

Error attached is shown.
No tags attached.
png issue_28847.png (269,968) 2014-12-24 14:47
https://issues.openbravo.com/file_download.php?file_id=7637&type=bug
Issue History
2014-12-24 14:46psanjuanNew Issue
2014-12-24 14:46psanjuanAssigned To => dmiguelez
2014-12-24 14:46psanjuanModules => Core
2014-12-24 14:46psanjuanTriggers an Emergency Pack => No
2014-12-24 14:46psanjuanAssigned Todmiguelez => umartirena
2014-12-24 14:47psanjuanFile Added: issue_28847.png
2015-01-02 15:46hgbotCheckin
2015-01-02 15:46hgbotNote Added: 0073297
2015-01-02 15:46hgbotStatusnew => resolved
2015-01-02 15:46hgbotResolutionopen => fixed
2015-01-02 15:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/2161bdf912255eb7554b0e691418727a1cceeea5 [^]
2015-01-07 14:35psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7402#r7402
2015-01-07 14:35psanjuanNote Added: 0073331
2015-01-07 14:35psanjuanStatusresolved => closed
2015-01-13 15:41SandrahuguetNote Added: 0073463
2015-02-04 20:33hudsonbotCheckin
2015-02-04 20:33hudsonbotNote Added: 0074099

Notes
(0073297)
hgbot   
2015-01-02 15:46   
Repository: erp/devel/pi
Changeset: 2161bdf912255eb7554b0e691418727a1cceeea5
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Wed Dec 31 16:16:00 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/2161bdf912255eb7554b0e691418727a1cceeea5 [^]

Fixes Bug 28487: Fixed Null Pointer Exception.

The problem was that in updateBDCostingTimeRange function inside AverageCostAdjustment class, the code was trying to get the movement date of a Inventory Transaction related to a Costing record. But not all costing have Inventory Transaction, so it was giving a NPE.
Now, if there is a previous Costing record than the one created due to a backdated transaction, this Costing will be shortened till transaction process date, and the new Backdated costing record will start at that moment.
This only happens the first time that a related transaction is found that is not a backdated transaction, because if is done with a backdated transaction time overlap can happen.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0073331)
psanjuan   
2015-01-07 14:35   
Verified.
(0073463)
Sandrahuguet   
2015-01-13 15:41   
Code review done
(0074099)
hudsonbot   
2015-02-04 20:33   
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/f36c91d0ad63 [^]
Maturity status: Test