details:   https://code.openbravo.com/erp/devel/pi/rev/2f55fbbf6677
changeset: 20437:2f55fbbf6677
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Wed May 22 11:14:54 2013 +0200
summary:   Related to issue 23870: Foreign key property field values are shown 
in the grid

The problem was that the datasource was returning the identifier of the 
property field like this:
- shipmentReceipt.documentType$_identifier: 'MM Shipment'
instead of like this:
- shipmentReceipt$documentType$_identifier: 'MM Shipment'

When a new value is added in the DataToJsonConverter, the dots in the property 
names are replaced with '$' (DalUtil.FIELDSEPARATOR). There were some places 
were this replacement was not being done.

diffstat:

 
modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
 |  16 +++++----
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (29 lines):

diff -r 5ca23b222c63 -r 2f55fbbf6677 
modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
--- 
a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
        Wed May 22 12:05:58 2013 +0530
+++ 
b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DataToJsonConverter.java
        Wed May 22 11:14:54 2013 +0200
@@ -262,16 +262,18 @@
           referencingProperty.getDisplayPropertyName());
       if (displayColumnProperty.hasDisplayColumn()) {
         // Allowing one level deep of displayed column pointing to references 
with display column
-        jsonObject.put(propertyName + DalUtil.FIELDSEPARATOR + 
JsonConstants.IDENTIFIER,
-            ((BaseOBObject) 
obObject.get(referencingProperty.getDisplayPropertyName()))
-                .get(displayColumnProperty.getDisplayPropertyName()));
+        jsonObject.put(propertyName.replace(DalUtil.DOT, 
DalUtil.FIELDSEPARATOR)
+            + DalUtil.FIELDSEPARATOR + JsonConstants.IDENTIFIER, 
((BaseOBObject) obObject
+            
.get(referencingProperty.getDisplayPropertyName())).get(displayColumnProperty
+            .getDisplayPropertyName()));
       } else if (!displayColumnProperty.isPrimitive()) {
         // Displaying identifier for non primitive properties
-        jsonObject.put(propertyName + DalUtil.FIELDSEPARATOR + 
JsonConstants.IDENTIFIER,
-            ((BaseOBObject) 
obObject.get(referencingProperty.getDisplayPropertyName()))
-                .getIdentifier());
+        jsonObject.put(propertyName.replace(DalUtil.DOT, 
DalUtil.FIELDSEPARATOR)
+            + DalUtil.FIELDSEPARATOR + JsonConstants.IDENTIFIER, 
((BaseOBObject) obObject
+            
.get(referencingProperty.getDisplayPropertyName())).getIdentifier());
       } else {
-        jsonObject.put(propertyName + DalUtil.FIELDSEPARATOR + 
JsonConstants.IDENTIFIER,
+        jsonObject.put(propertyName.replace(DalUtil.DOT, 
DalUtil.FIELDSEPARATOR)
+            + DalUtil.FIELDSEPARATOR + JsonConstants.IDENTIFIER,
             obObject.get(referencingProperty.getDisplayPropertyName()));
       }
     } else {

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to