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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0020137
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Modules] APR Migration Toolmajoralways2012-03-28 13:462012-03-28 13:46
ReportermiruritaView Statuspublic 
Assigned Tomirurita 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Regression date
Regression introduced by commit
Regression level
Review Assigned To
Regression introduced in release
Summary

0020137: Migration tool methods modifying OrganizationStructureProvider class attributes

DescriptionDue 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");

Steps To Reproduce1) 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.
Proposed Solutioncreate a new instance as follows

Set<String> organizations = new HashSet<String>(OBContext.getOBContext().getOrganizationStructureProvider(org.getClient().getId()).getParentTree(org.getId(), true));
organizations.add("0");
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2012-03-28 13:46 mirurita New Issue
2012-03-28 13:46 mirurita Assigned To => mirurita


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker