Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029574Openbravo ERP04. Warehouse managementpublic2015-04-13 16:542015-05-07 22:16
VictorVillar 
jorge-garcia 
immediatemajoralways
closedfixed 
5
pi 
pi 
umartirena
Core
No
0029574: 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();
No tags attached.
depends on backport 00295843.0PR15Q2 closed jorge-garcia It is not possible to reactivate a Landed Cost under some circumstancies 
depends on backport 00295853.0PR15Q1.3 closed jorge-garcia It is not possible to reactivate a Landed Cost under some circumstancies 
Issue History
2015-04-13 16:54VictorVillarNew Issue
2015-04-13 16:54VictorVillarAssigned To => umartirena
2015-04-13 16:54VictorVillarModules => Core
2015-04-13 16:54VictorVillarResolution time => 1429048800
2015-04-13 16:54VictorVillarTriggers an Emergency Pack => No
2015-04-13 16:54VictorVillarIssue Monitored: networkb
2015-04-14 12:48Triage FinanceAssigned Toumartirena => Triage Finance
2015-04-14 17:17umartirenaStatusnew => scheduled
2015-04-14 17:24eduardo_ArgalAssigned ToTriage Finance => jorge-garcia
2015-04-14 18:04hgbotCheckin
2015-04-14 18:04hgbotNote Added: 0076537
2015-04-14 18:04hgbotStatusscheduled => resolved
2015-04-14 18:04hgbotResolutionopen => fixed
2015-04-14 18:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8ca445154dbb2682bc9f2b085ffb09a5febdaccb [^]
2015-04-14 19:19umartirenaReview Assigned To => umartirena
2015-04-14 19:19umartirenaNote Added: 0076543
2015-04-14 19:19umartirenaStatusresolved => closed
2015-04-14 19:19umartirenaFixed in Version => pi
2015-05-07 22:16hudsonbotCheckin
2015-05-07 22:16hudsonbotNote Added: 0077126

Notes
(0076537)
hgbot   
2015-04-14 18:04   
Repository: erp/devel/pi
Changeset: 8ca445154dbb2682bc9f2b085ffb09a5febdaccb
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Apr 14 09:56:20 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/8ca445154dbb2682bc9f2b085ffb09a5febdaccb [^]

Fixed issue 29574: 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
---
(0076543)
umartirena   
2015-04-14 19:19   
Code Review + Testing OK
(0077126)
hudsonbot   
2015-05-07 22:16   
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/a1817f84bd8b [^]
Maturity status: Test