Fixed issue 19915. The problem seems to be that the auxiliary input list of a tab is sometimes not correctly initialized.
authorAntonio Moreno <antonio.moreno@openbravo.com>
Wed, 29 Feb 2012 11:47:06 +0100
changeset 15644 42e673c6c4f9
parent 15643 10e3111439cc
child 15645 7f69d5ac8a7e
Fixed issue 19915. The problem seems to be that the auxiliary input list of a tab is sometimes not correctly initialized.
Therefore, the fix will consist on initializing the list and its contents before returning it. Also, just for precaution, a new list containing the instances will be created and returned
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java	Wed Feb 29 09:55:09 2012 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java	Wed Feb 29 11:47:06 2012 +0100
@@ -19,6 +19,7 @@
 package org.openbravo.client.application.window;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -137,7 +138,11 @@
       return auxInputMap.get(tabId);
     }
     Tab tab = OBDal.getInstance().get(Tab.class, tabId);
-    List<AuxiliaryInput> auxInputs = tab.getADAuxiliaryInputList();
+    Hibernate.initialize(tab.getADAuxiliaryInputList());
+    List<AuxiliaryInput> auxInputs = new ArrayList<AuxiliaryInput>(tab.getADAuxiliaryInputList());
+    for (AuxiliaryInput auxIn : auxInputs) {
+      Hibernate.initialize(auxIn);
+    }
     auxInputMap.put(tabId, auxInputs);
     return auxInputs;
   }