details:   /erp/devel/pi/rev/b48da9451e38
changeset: 10905:b48da9451e38
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Feb 28 12:48:17 2011 +0100
summary:   Fixes issue 15993: Reference creation issue

diffstat:

 
modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
 |  21 +++++++--
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
    |   5 --
 2 files changed, 16 insertions(+), 10 deletions(-)

diffs (53 lines):

diff -r 67b4bfacea4c -r b48da9451e38 
modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
       Mon Feb 28 11:35:37 2011 +0100
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationUtils.java
       Mon Feb 28 12:48:17 2011 +0100
@@ -98,9 +98,16 @@
     if (tab.getColumn() != null) {
       final String columnId = (String) DalUtil.getId(tab.getColumn());
       for (Property property : thisEntity.getProperties()) {
-        if (!property.isId() && property.getColumnId() != null
-            && property.getColumnId().equals(columnId)) {
-          parentProperty = property.getName();
+        if (property.isPrimitive() || property.isOneToMany()) {
+          continue;
+        }
+        if (property.getColumnId() != null && 
property.getColumnId().equals(columnId)) {
+          if (property.isOneToOne()) {
+            parentProperty = "id";
+          } else {
+            parentProperty = property.getName();
+          }
+          break;
         }
       }
     } else {
@@ -108,8 +115,12 @@
         if (property.isPrimitive() || property.isOneToMany()) {
           continue;
         }
-        if (!property.isId() && property.getTargetEntity() == parentEntity) {
-          parentProperty = property.getName();
+        if (property.getTargetEntity() == parentEntity) {
+          if (property.isOneToOne()) {
+            parentProperty = "id";
+          } else {
+            parentProperty = property.getName();
+          }
           break;
         }
       }
diff -r 67b4bfacea4c -r b48da9451e38 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Mon Feb 28 11:35:37 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
  Mon Feb 28 12:48:17 2011 +0100
@@ -479,11 +479,6 @@
       }
     }
     
-    // ignore the id
-    if (field.name === OB.Constants.ID) {
-      return;
-    }
-    
     // note field can be a datasource field, see above, in that case
     // don't set the entries    
     if (field.form && entries) {

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to