details:   https://code.openbravo.com/erp/devel/pi/rev/643bf6486d11
changeset: 26099:643bf6486d11
user:      Unai Martirena <unai.martirena <at> openbravo.com>
date:      Fri Feb 27 14:51:17 2015 +0100
summary:   Fixes bug 29093: LazyInitializationException avoided calculating BOM 
prod. cost

prodLine has been reloaded in case cost calculation of previous BOM Product has 
cleared the session.

diffstat:

 src/org/openbravo/costing/CostingAlgorithm.java |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 70dd176270f0 -r 643bf6486d11 
src/org/openbravo/costing/CostingAlgorithm.java
--- a/src/org/openbravo/costing/CostingAlgorithm.java   Mon Feb 16 18:10:06 
2015 +0100
+++ b/src/org/openbravo/costing/CostingAlgorithm.java   Fri Feb 27 14:51:17 
2015 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2012-2014 Openbravo SLU
+ * All portions are Copyright (C) 2012-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -487,6 +487,9 @@
     parts.remove(transaction.getProductionLine());
     BigDecimal totalCost = BigDecimal.ZERO;
     for (ProductionLine prodLine : parts) {
+      // Reload from database in case previous partTrx cost calculation has 
cleared the session.
+      prodLine = (ProductionLine) 
OBDal.getInstance().getProxy(ProductionLine.ENTITY_NAME,
+          prodLine.getId());
       MaterialTransaction partTransaction = 
prodLine.getMaterialMgmtMaterialTransactionList()
           .get(0);
       // Reload from database in case previous partTrx cost calculation has 
cleared the session.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to