details:   /erp/devel/pi/rev/33867e2a810b
changeset: 12131:33867e2a810b
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Thu May 12 15:41:09 2011 +0200
summary:   Fixed issue 17129. Key columns will be explicitly set in the session.
This change is necessary because a big number of fields corresponding to key 
columns have been removed as part of the cleanup project, so in several tabs, 
the key column no longer has a field.

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
 |  11 ++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r 1b57600d5691 -r 33867e2a810b 
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
     Thu May 12 14:57:37 2011 +0200
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
     Thu May 12 15:41:09 2011 +0200
@@ -173,6 +173,9 @@
                 jsonValue = uiDef.createFromClassicString((String) jsonValue);
               }
               convertedJson.put(property.getName(), jsonValue);
+              if (property.isId()) {
+                setSessionValue(tab.getWindow().getId() + "|" + 
property.getColumnName(), jsonValue);
+              }
             }
           }
         }
@@ -181,6 +184,14 @@
         convertedJson.put(JsonConstants.ENTITYNAME, entity.getName());
         row = fromJsonConverter.toBaseOBObject(convertedJson);
         row.setNewOBObject(true);
+      } else {
+        final Entity entity = ModelProvider.getInstance().getEntityByTableName(
+            tab.getTable().getDBTableName());
+        for (Property property : entity.getProperties()) {
+          if (property.isId()) {
+            setSessionValue(tab.getWindow().getId() + "|" + 
property.getColumnName(), row.getId());
+          }
+        }
       }
 
       // First the parent record is retrieved and the session variables for 
the parent records are

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to