Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016430Openbravo ERPA. Platformpublic2011-03-22 12:422011-06-07 12:34
dalsasua 
alostale 
urgentmajoralways
closedfixed 
20Ubuntu 10.10
2.50MP27 
 
Core
No
0016430: OrganizationStructureProvider.getChildTree() fails if there exists just one organization, that is not summary
OrganizationStructureProvider.getChildTree() fails if there exists just one organization, that is not summary
1.- Install "Chart of accounts: PGC 2007 General", "Spain Taxes", "Invoice Register Book" and "ConfiguraciĆ³n de Impuestos para el Libro de Facturas" modules
2.- Run Initial Client Setup, applying all the reference data available, and clicking on "Create Accounting".
3.- Change role to the new client admin one.
4.- Run Initial Organization Setup, org type: Legal Entity With Accounting
5.- Go to organization window, flag allow period control, and choose the existing calendar.
6.- Run the set as ready process.
7.- Create a business partner category, and a business partner; set a location for it.
8.- Create a product category and a product.
9.- Create a price list version and a price list, giving a price to the created product.
10.- Create a payment term
11.- Create an invoice for the created business partner, with a line with the created product.
12.- Process and post the invoice.
13.- Create a invoice register book, and notice that a null pointer exception is returned.
diff --git a/src/org/openbravo/dal/security/OrganizationStructureProvider.java b/src/org/openbravo/dal/security/OrganizationStructureProvider.java
--- a/src/org/openbravo/dal/security/OrganizationStructureProvider.java
+++ b/src/org/openbravo/dal/security/OrganizationStructureProvider.java
@@ -263,6 +263,9 @@
    */
   public Set<String> getChildOrg(String orgId) {
     initialize();
+ if (childByOrganizationID.get(orgId) == null) {
+ reInitialize();
+ }
     return childByOrganizationID.get(orgId);
   }
No tags attached.
blocks defect 0016419 closed alostale OrganizationStructureProvider.getChildTree() fails if there exists just one organization, that is not summary 
Issue History
2011-03-23 08:33alostaleTypedefect => backport
2011-03-23 08:33alostalefix_in_branch => 2.50
2011-03-24 07:27dalsasuaProposed Solution updated
2011-03-24 07:27dalsasuaAssigned Tomtaal => alostale
2011-03-29 12:07hgbotCheckin
2011-03-29 12:07hgbotNote Added: 0035303
2011-03-29 12:07hgbotStatusscheduled => resolved
2011-03-29 12:07hgbotResolutionopen => fixed
2011-03-29 12:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/stable/2.50/rev/ae758ab4ba4653538c907b6f2dc422124c19f43f [^]
2011-06-07 12:34shuehnerNote Added: 0038113
2011-06-07 12:34shuehnerStatusresolved => closed

Notes
(0035303)
hgbot   
2011-03-29 12:07   
Repository: erp/stable/2.50
Changeset: ae758ab4ba4653538c907b6f2dc422124c19f43f
Author: David Alsasua <david.alsasua <at> openbravo.com>
Date: Thu Mar 24 07:37:17 2011 +0100
URL: http://code.openbravo.com/erp/stable/2.50/rev/ae758ab4ba4653538c907b6f2dc422124c19f43f [^]

Fixes issue 16430.
Following Martin instructions, this changeset is pushed to fix the issue.

---
M src/org/openbravo/dal/security/OrganizationStructureProvider.java
---
(0038113)
shuehner   
2011-06-07 12:34   
Tested on stable/2.50,pgsql (rev: 13e8fb0e80c1) Mentioned steps in the the issue are now working fine without any NPE.