Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036099
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2017-05-25 12:052017-05-29 17:43
ReporterngarciaView Statuspublic 
Assigned Tomarkmm82 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q3
StatusclosedFix in branchFixed in SCM revision13966655c3a8
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Merge Request Status
Review Assigned Toaferraz
OBNetwork customerOBPS
Web browser
ModulesCore
Support ticket46891
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036099: Price Correction Background finishes with error if a goods receipt is invoiced after the costing migration process was run

DescriptionPrice Correction Background finishes with error if a goods receipt is invoiced after the costing migration process was run
Steps To ReproduceInstall the 3.0MP12.2 version

As group admin role:
   Go to Open/Close Period Control and open the current period (create it in
   Fiscal Calendar window if needed)
   Create a product
   Add a purchase price to it
   Add a valid average cost to it
   Create a purchase order and a goods receipt to it

Upgrade the instance to the last version

As group admin role (for each client):
   Open the current period for all the calendars in all the entities

As System admin role:
   Launch the Costing Migration Process
   If it finishes with the Transactions without cost error, set as inactive the Products with transactions without available cost on date alert
   Launch the Costing Migration Process again and check it finishes successfully

As group admin role (for each client):
   Process all the 'Cost Rule Opening Inventory' inventories
   Create a Purchase Invoice for the previously created Goods Receipt
   Go to Process Request window and schedule the Price Correction Background process
   Check it finishes with error and the log shows:
      
ERROR org.openbravo.service.db.DalBaseProcess - The process org.openbravo.costing.PriceDifferenceBackground has thrown an exception.
java.lang.NullPointerException
    at org.openbravo.costing.PriceDifferenceProcess.calculateTransactionPriceDifferenceLogic(PriceDifferenceProcess.java:57)
    at org.openbravo.costing.PriceDifferenceProcess.calculateTransactionPriceDifference(PriceDifferenceProcess.java:165)
    at org.openbravo.costing.PriceDifferenceProcess.processPriceDifference(PriceDifferenceProcess.java:238)
    at org.openbravo.costing.PriceDifferenceBackground.doExecute(PriceDifferenceBackground.java:50)
Proposed SolutionCheck if transactions previous to the migration should be adjusted or not. The problem is that the transactions previous to the migration are generated without m_costing_algorithm_id and the c_invoice_post function in this case, sets the transaction as checkpricedifference = Y
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0096819)
aferraz (viewer)
2017-05-25 18:14

Transactions previous to the migration should not be adjusted.
Avoid NPE in PriceDifferenceProcess.calculateTransactionPriceDifferenceLogic:

// Without algorithm or with Standard Algorithm, no cost adjustment is needed
    if (materialTransaction.getCostingAlgorithm() == null
        || StringUtils.equals(materialTransaction.getCostingAlgorithm().getJavaClassName(),
            "org.openbravo.costing.StandardAlgorithm")) {
      return false;
    }
(0096822)
markmm82 (viewer)
2017-05-25 20:56

Test Plan:

Install the 3.0MP12.2 version

As group admin role:
   Go to Open/Close Period Control and open the current period (create it in
   Fiscal Calendar window if needed)
   Create a product
   Add a purchase price to it
   Add a valid average cost to it
   Create a purchase order and a goods receipt to it

Upgrade the instance to the last version

As group admin role (for each client):
   Open the current period for all the calendars in all the entities

As System admin role:
   Launch the Costing Migration Process
   If it finishes with the Transactions without cost error, set as inactive the Products with transactions without available cost on date alert
   Launch the Costing Migration Process again and check it finishes successfully

As group admin role (for each client):
   Process all the 'Cost Rule Opening Inventory' inventories
   Create a Purchase Invoice for the previously created Goods Receipt
   Go to Process Request window and schedule the Price Correction Background process
   Check it finishes with SUCCESS message.
(0096833)
hgbot (developer)
2017-05-26 08:36

Repository: erp/devel/pi
Changeset: 13966655c3a8c66f12d3e4aa74ece452756e2826
Author: Mark <markmm82 <at> gmail.com>
Date: Thu May 25 13:16:54 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/13966655c3a8c66f12d3e4aa74ece452756e2826 [^]

Fixes issue 36099: Price Correction Background finishes with error
if a goods receipt is invoiced after the costing migration process was run

Price Correction Background finishes with error if a goods receipt is invoiced
after the costing migration process was run. The problem is that the transactions
previous to the migration are generated without m_costing_algorithm_id and the
c_invoice_post function in this case, sets the transaction as checkpricedifference = Y.

To fix that, transactions previous to the migration will not be adjusted.
To avoid NPE in PriceDifferenceProcess.calculateTransactionPriceDifferenceLogic
was included a validation taking into account all explained above.

---
M src/org/openbravo/costing/PriceDifferenceProcess.java
---
(0096834)
aferraz (viewer)
2017-05-26 08:38

Code review OK
(0096995)
hudsonbot (viewer)
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

- Issue History
Date Modified Username Field Change
2017-05-25 12:05 ngarcia New Issue
2017-05-25 12:05 ngarcia Assigned To => Triage Finance
2017-05-25 12:05 ngarcia OBNetwork customer => Yes
2017-05-25 12:05 ngarcia Modules => Core
2017-05-25 12:05 ngarcia Support ticket => 46891
2017-05-25 12:05 ngarcia Resolution time => 1497477600
2017-05-25 12:05 ngarcia Triggers an Emergency Pack => No
2017-05-25 12:06 ngarcia Issue Monitored: networkb
2017-05-25 13:07 heccam Issue Monitored: heccam
2017-05-25 18:14 aferraz Note Added: 0096819
2017-05-25 18:15 aferraz Assigned To Triage Finance => markmm82
2017-05-25 18:46 markmm82 Status new => scheduled
2017-05-25 20:56 markmm82 Note Added: 0096822
2017-05-26 08:36 hgbot Checkin
2017-05-26 08:36 hgbot Note Added: 0096833
2017-05-26 08:36 hgbot Status scheduled => resolved
2017-05-26 08:36 hgbot Resolution open => fixed
2017-05-26 08:36 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/13966655c3a8c66f12d3e4aa74ece452756e2826 [^]
2017-05-26 08:38 aferraz Review Assigned To => aferraz
2017-05-26 08:38 aferraz Note Added: 0096834
2017-05-26 08:38 aferraz Status resolved => closed
2017-05-26 08:38 aferraz Fixed in Version => 3.0PR17Q3
2017-05-29 17:43 hudsonbot Checkin
2017-05-29 17:43 hudsonbot Note Added: 0096995


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker