details:   /erp/devel/pi/rev/01ee143af834
changeset: 11582:01ee143af834
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Fri Apr 15 13:05:41 2011 +0200
summary:   Fixes issue 16818: Save button in Product window sometimes doesn't 
work

diffstat:

 
modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java
 |  13 ++++++++-
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r 6269327721fd -r 01ee143af834 
modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java
--- 
a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java
        Thu Apr 14 21:04:03 2011 +0200
+++ 
b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java
        Fri Apr 15 13:05:41 2011 +0200
@@ -398,8 +398,17 @@
           }
         } else if (property.getDomainType() instanceof BigDecimalDomainType
             && jsonObject.has(keyName + "_textualValue")) {
-          setValue(obObject, property,
-              new BigDecimal((String) jsonObject.get(keyName + 
"_textualValue")));
+          final String strValue = (String) jsonObject.get(keyName + 
"_textualValue");
+          try {
+            if (strValue == null || strValue.trim().length() == 0) {
+              setValue(obObject, property, null);
+            } else {
+              setValue(obObject, property, new BigDecimal(strValue));
+            }
+          } catch (Exception e) {
+            throw new OBException("Exception while trying to convert 
value:-->" + strValue + "<-- "
+                + e.getMessage(), e);
+          }
         } else {
           setValue(obObject, property, jsonObject.get(keyName));
         }

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to