Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029584Openbravo ERP04. Warehouse managementpublic2015-04-13 16:542015-04-14 19:18
VictorVillar 
jorge-garcia 
immediatemajoralways
closedfixed 
5
pi 
3.0PR15Q23.0PR15Q2 
umartirena
Core
No
0029584: It is not possible to reactivate a Landed Cost under some circumstancies
It is not possible to reactivate a Landed Cost under some circumstancies. Necessary to have more than 100 registers in M_LC_ReceiptLine_Amt table. For instance, 1 Goods receipt with 200 lines and one landed cost affecting to this Landed Cost.
Necessary to have more than 100 registers in M_LC_ReceiptLine_Amt table. For instance, 1 Goods receipt with 200 lines and one landed cost affecting to this Landed Cost.
Once you have completed it and you try to reactivate it, you receive the following error:

'a different object with the same identifier value was already associated with the session: [LandedCostReceiptLineAmt#38B8F2EA56834B20A02AB4C111E5903D]'

It seems that the problem is in LandedCostDistributionAlgorithm.java -- method: cancelDistributeAmount.

OBDal.getInstance().save(lcCost);

We have checked in the client's environment that the following change is fixing the problem.

List<String> idList = OBDao.getIDListFromOBObject(lcCost.getLandedCostReceiptLineAmtList());
++++ OBDal.getInstance().save(lcCost);

      for (String id : idList) {
        i++;
        LCReceiptLineAmt lcrla = OBDal.getInstance().get(LCReceiptLineAmt.class, id);
        lcCost.getLandedCostReceiptLineAmtList().remove(lcrla);
        OBDal.getInstance().remove(lcrla);
               if (i % 100 == 0) {
----- OBDal.getInstance().save(lcCost);
          OBDal.getInstance().flush();
          OBDal.getInstance().getSession().clear();
Approved
blocks defect 0029574 closed jorge-garcia It is not possible to reactivate a Landed Cost under some circumstancies 
Issue History
2015-04-14 17:17umartirenaTypedefect => backport
2015-04-14 17:17umartirenaTarget Version => 3.0PR15Q2
2015-04-14 17:20dmitry_mezentsevTag Attached: Approved
2015-04-14 17:23eduardo_ArgalAssigned ToTriage Finance => jorge-garcia
2015-04-14 19:17hgbotCheckin
2015-04-14 19:17hgbotNote Added: 0076540
2015-04-14 19:17hgbotStatusscheduled => resolved
2015-04-14 19:17hgbotResolutionopen => fixed
2015-04-14 19:17hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q2/rev/9da5f0781b8a1fd9ce02d0355035759e08e68b1a [^]
2015-04-14 19:18umartirenaReview Assigned To => umartirena
2015-04-14 19:18umartirenaNote Added: 0076542
2015-04-14 19:18umartirenaStatusresolved => closed
2015-04-14 19:18umartirenaFixed in Version => 3.0PR15Q2

Notes
(0076540)
hgbot   
2015-04-14 19:17   
Repository: erp/backports/3.0PR15Q2
Changeset: 9da5f0781b8a1fd9ce02d0355035759e08e68b1a
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Apr 14 18:24:05 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2/rev/9da5f0781b8a1fd9ce02d0355035759e08e68b1a [^]

Fixed issue 29584: It is not possible to reactivate a Landed Cost

It is not possible to reactivate a Landed Cost under some circunstances.
The problem was fixed from the LandedCostDistributionAlgorithm.java

When you try to reactivate a Landed Cost, an error message appears and
the process was cancelled

Now the process is done succesfully and the Landed Cost can be reactivated.

---
M src/org/openbravo/costing/LandedCostDistributionAlgorithm.java
---
(0076542)
umartirena   
2015-04-14 19:18   
Code Review + Testing OK