Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034563Openbravo ERP04. Warehouse managementpublic2016-11-17 15:412016-12-16 18:39
ngarcia 
Sanjota 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q1 
aferraz
Core
No
0034563: Index: 0, Size: 0 error when launching Costing Migration Process
Index: 0, Size: 0 error when launching Costing Migration Process
As system admin role:
   Install the 3.0MP12.2 version
   Upgrade it to pi
   Note: I need to launch the following command as the Costing Algorithms were not present in the system after recompiling it:
      ant apply.module -DforceRefData=true
      ant smartbuild
As group admin roles:
   Create 2016 year and periods for all the legal with accounting organizations in the system
   Open them
As system admin role:
   Launch the Costing Migration process
   Check it launches a warning that there are transactions without cost
   Set as inactive the 'Products with transactions without available cost on date.' alert
   Launch the Costing Migration process again
   Check the 'Index: 0, Size: 0 ' error message is shown and the log shows:
      ERROR org.openbravo.costing.CostingMigrationProcess - Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:635)
    at java.util.ArrayList.get(ArrayList.java:411)
    at org.hibernate.collection.PersistentBag.get(PersistentBag.java:446)
    at org.openbravo.costing.CostingMigrationProcess.calculateCosts(CostingMigrationProcess.java:515)
    at org.openbravo.costing.CostingMigrationProcess.createRules(CostingMigrationProcess.java:470)
    at org.openbravo.costing.CostingMigrationProcess.execute(CostingMigrationProcess.java:124)
    at org.openbravo.erpCommon.ad_actionButton.ActionButtonJava_Responser.process64B3FF29AC174F4B94538BD0A3CE1CD3(ActionButtonJava_Responser.java:2732)
    at org.openbravo.erpCommon.ad_actionButton.ActionButtonJava_Responser.doPost(ActionButtonJava_Responser.java:273)
The problem is in the following piece of code:

MaterialTransaction trx = icl.getMaterialMgmtMaterialTransactionList().get(0);

the record in the m_transaction table associated to the m_inventoryline is not available
No tags attached.
related to defect 0034662 closed Sanjota If we launch costing migration process the last day of a month, PeriodClosedForMMI error is thrown 
blocks defect 0034564 closed Sanjota Duplicated records in m_transactioncost table after launching the Costing Migration Process 
Issue History
2016-11-17 15:41ngarciaNew Issue
2016-11-17 15:41ngarciaAssigned To => Triage Finance
2016-11-17 15:41ngarciaModules => Core
2016-11-17 15:41ngarciaResolution time => 1481151600
2016-11-17 15:41ngarciaTriggers an Emergency Pack => No
2016-11-17 15:43ngarciaRelationship addedblocks 0034564
2016-11-17 15:44ngarciaIssue Monitored: networkb
2016-11-18 09:32aferrazAssigned ToTriage Finance => Sanjota
2016-11-21 06:44SanjotaStatusnew => scheduled
2016-11-25 13:15SanjotaNote Added: 0091839
2016-12-01 09:58aferrazRelationship addedrelated to 0034662
2016-12-01 14:44hgbotCheckin
2016-12-01 14:44hgbotNote Added: 0091969
2016-12-01 14:44hgbotStatusscheduled => resolved
2016-12-01 14:44hgbotResolutionopen => fixed
2016-12-01 14:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d8bca1491fa673bef625cc2978885f1ee6e20f30 [^]
2016-12-01 14:46aferrazReview Assigned To => aferraz
2016-12-01 14:46aferrazNote Added: 0091972
2016-12-01 14:46aferrazStatusresolved => closed
2016-12-01 14:46aferrazFixed in Version => 3.0PR17Q1
2016-12-16 18:39hudsonbotCheckin
2016-12-16 18:39hudsonbotNote Added: 0092676

Notes
(0091839)
Sanjota   
2016-11-25 13:15   
Create new instance (application with 3.0MP12.2 version)
   Upgrade it to pi -hg pull -u
Build instance - ant smartbuild -Dlocal=no -Dforce=true
   Note: I need to launch the following command as the Costing Algorithms were not present in the system after recompiling it:
      ant apply.module -DforceRefData=true
      ant smartbuild
As group admin roles:
   Create 2016 year and periods for all the legal with accounting organizations in the system
   Open them
As system admin role:
   Launch the Costing Migration process
   Check it launches a warning that there are transactions without cost
   Set as inactive the 'Products with transactions without available cost on date.' alert
   Launch the Costing Migration process again
   Observe that the process runs successfully(without any error).
(0091969)
hgbot   
2016-12-01 14:44   
Repository: erp/devel/pi
Changeset: d8bca1491fa673bef625cc2978885f1ee6e20f30
Author: Sanjota <sanjota.nelagi <at> promantia.com>
Date: Fri Nov 25 17:37:41 2016 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/d8bca1491fa673bef625cc2978885f1ee6e20f30 [^]

Fixes issue 34563: NPE issue in Costing Migration Process

Resolved "Index: 0, Size: 0" error when launching Costing Migration process.

---
M src/org/openbravo/costing/CostingMigrationProcess.java
---
(0091972)
aferraz   
2016-12-01 14:46   
Code review + Testing OK
(0092676)
hudsonbot   
2016-12-16 18:39   
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/dc8bf00badd0 [^]
Maturity status: Test