Fixes issue 24461: Date fields can be modified from callouts more than once
authorAugusto Mauch <augusto.mauch@openbravo.com>
Tue, 20 Aug 2013 14:28:41 +0200
changeset 21030 e7643eff94a4
parent 20982 3ca2970a5892
child 21031 87a67cacdd7a
Fixes issue 24461: Date fields can be modified from callouts more than once

Due to a change done in this changeset [1], modifying a date field from a callout only worked the first time, from then on the value was not updated. This is caused because when a date time is modified from a callout its _textChanged property is set to true, but never set back to false (this property should only be true the time while this field is being updated). Setting it back to false after modifying its value from a callout fixes the problem.

[1] https://code.openbravo.com/erp/devel/pi/rev/4060f2b5e6bd2429d831c5e30cc4d45892efcd96
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 Aug 13 04:34:41 2013 +0000
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Tue Aug 20 14:28:41 2013 +0200
@@ -978,8 +978,14 @@
       isImage = field.type && isc.SimpleType.getType(field.type).inheritsFrom === 'image';
       if (isDate) {
         this.setItemValue(field.name, isc.Date.parseSchemaDate(columnValue.value));
+        if (field.textField) {
+          delete field.textField._textChanged;
+        }
       } else if (isDateTime) {
         this.setItemValue(field.name, isc.Date.parseStandardDate(columnValue.value));
+        if (field.textField) {
+          delete field.textField._textChanged;
+        }
       } else if (isImage) {
         //calls setValue to handle buttons display for read-only windows
         this.setValue(field.name, assignValue);