Openbravo Issue Tracking System - Modules
View Issue Details
0020137ModulesAPR Migration Toolpublic2012-03-28 13:462012-03-28 13:46
mirurita 
mirurita 
normalmajoralways
newopen 
5
 
 
0020137: Migration tool methods modifying OrganizationStructureProvider class attributes
Due to issue 20129, using the public API if you get the OrganizationStructureProvider of your client and then you query (i.e.) for the children organization the object you get is a reference of the attribute of OrganizationStructureProvider (not a new instance).
https://issues.openbravo.com/view.php?id=20129 [^]


org.openbravo.erputil.aprmigrationtool.entity.MigrateSettlementPayments
defaultFinancialAccount method:

Set<String> organizations = OBContext.getOBContext().getOrganizationStructureProvider(org.getClient().getId()).getParentTree(org.getId(), true);
organizations.add("0");

org.openbravo.erputil.aprmigrationtool.dao.MigrationToolDao
defaultFinancialAccount method:

Set<String> organizations = OBContext.getOBContext().getOrganizationStructureProvider(payment.getClient().getId()).getParentTree(payment.getOrganization().getId(), true);
organizations.add("0");

1) Check the value of the following attribute of OrganizationStructureProvider class:
private Map<String, String> parentByOrganizationID = new HashMap<String, String>();

2) Execute this code
Set<String> organizations = OBContext.getOBContext().getOrganizationStructureProvider(org.getClient().getId()).getParentTree(org.getId(), true);
organizations.add("0");

3) Check again the value of:
private Map<String, String> parentByOrganizationID = new HashMap<String, String>();

Realize that "0" is a new element of the Map.
create a new instance as follows

Set<String> organizations = new HashSet<String>(OBContext.getOBContext().getOrganizationStructureProvider(org.getClient().getId()).getParentTree(org.getId(), true));
organizations.add("0");
No tags attached.
Issue History
2012-03-28 13:46miruritaNew Issue
2012-03-28 13:46miruritaAssigned To => mirurita

There are no notes attached to this issue.