Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029678Openbravo ERP04. Warehouse managementpublic2015-04-22 11:372015-04-24 11:30
VictorVillar 
umartirena 
immediatemajoralways
closedfixed 
5
pi 
3.0PR15Q1.4 
vmromanos
Core
Production - QA Approved
2014-08-20
3.0PR14Q4
https://code.openbravo.com/erp/devel/pi/rev/186b3f5bcf21 [^]
No
0029678: Null Pointer exception of the Costing Background Process when you are creating a new costing rule (standard)
Null Pointer exception of the Costing Background Process when you are creating a new costing rule (standard)
As group admin role,
 Go to Costing rule:
    create a new costing rule -> type: Standard
    Org: US
    Warehouse dimension: No
    Backdated transactions fixed: Yes (also it happens, if you do not check it)
    Fix Backdated From: Blank
Validate it.

 Go to Process Request window,
    Unschedule the costing background process
    Create a new one: Run inmediately.
Go to Process Monitor window,
   Realise that the process has 'Success' status but there is nothing in the Process Log.

The reason:
867946fe 84026822 [DefaultQuartzScheduler_Worker-8] ERROR org.openbravo.costing.CostingBackground -
java.lang.NullPointerException
    at org.openbravo.costing.StandardAlgorithm.getOpeningInventoryCost(StandardAlgorithm.java:63)
    at org.openbravo.costing.StandardAlgorithm.getTransactionCost(StandardAlgorithm.java:38)
    at org.openbravo.costing.CostingServer.process(CostingServer.java:104)
    at org.openbravo.costing.CostingBackground.doExecute(CostingBackground.java:119)
    at org.openbravo.service.db.DalBaseProcess.execute(DalBaseProcess.java:80)
    at org.openbravo.scheduling.DefaultJob.execute(DefaultJob.java:58)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)

Approved
blocks defect 00296663.0PR15Q2 closed umartirena Null Pointer exception of the Costing Background Process when you are creating a new costing rule (standard) 
Issue History
2015-04-23 10:07umartirenaTypedefect => backport
2015-04-23 10:07umartirenaTarget Version3.0PR15Q2 => 3.0PR15Q1.4
2015-04-23 12:50dmitry_mezentsevTag Attached: Approved
2015-04-24 11:29hgbotCheckin
2015-04-24 11:29hgbotNote Added: 0076742
2015-04-24 11:29hgbotStatusscheduled => resolved
2015-04-24 11:29hgbotResolutionopen => fixed
2015-04-24 11:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q1.4/rev/452ac30942ce9eb224f0571adb8608f02e07fc01 [^]
2015-04-24 11:30vmromanosReview Assigned To => vmromanos
2015-04-24 11:30vmromanosNote Added: 0076745
2015-04-24 11:30vmromanosStatusresolved => closed

Notes
(0076742)
hgbot   
2015-04-24 11:29   
Repository: erp/backports/3.0PR15Q1.4
Changeset: 452ac30942ce9eb224f0571adb8608f02e07fc01
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Thu Apr 23 10:16:31 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q1.4/rev/452ac30942ce9eb224f0571adb8608f02e07fc01 [^]

Fixes bug 29678: Fix NPE in Costing Background with Standard Costing Rule

In Cost Adjustment project new method has been added to calculate an opening inventory cost. This method uses 'CostingUtils.getStandardCostDefinition' method, that tries to get an standard cost for that opening inventory. If it does not found any standard or legacy cost, it returns null. So, in this moment a NPE error was happening. To fix this problem, at this point a controlled error is raised to notify the user that no cost has been found.

---
M src/org/openbravo/costing/StandardAlgorithm.java
---
(0076745)
vmromanos   
2015-04-24 11:30   
Code review + testing OK