fixed bug 32780: wrong amounts on new record just after processing another one
authorAsier Lostalé <asier.lostale@openbravo.com>
Tue, 26 Apr 2016 10:54:46 +0200
changeset 29599 29fa7f43f9da
parent 29598 ebfbe10490c0
child 29600 d386f41fa755
fixed bug 32780: wrong amounts on new record just after processing another one

When a new record was created (ie. for Order or Invoice) just after completing
a previous one, status bar values could get not updated. In case of numeric values
they preserved an obsolete textual value, which makes to update to previous value
when saving, even if the status bar reflects the new state.
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Tue Apr 26 10:50:48 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Tue Apr 26 10:54:46 2016 +0200
@@ -1196,8 +1196,13 @@
     }
 
     // store the textualvalue so that it is correctly send back to the server
-    if ((columnValue.classicValue || columnValue.classicValue === '') && typeInstance.decSeparator) {
-      this.setTextualValue(field.name, assignClassicValue, typeInstance);
+    if (typeInstance.decSeparator) {
+      if (columnValue.classicValue || columnValue.classicValue === '') {
+        this.setTextualValue(field.name, assignClassicValue, typeInstance);
+      } else {
+        // no textual value, reset it
+        this.setTextualValue(field.name, null, typeInstance);
+      }
     }
   },