# HG changeset patch
# User Shankar Balachandran <shankar.balachandran@openbravo.com>
# Date 1352989093 -3600
# Node ID 47524e6264b79777fae5a432a240047547bd7258
# Parent  ead23f919c59e97b82c9a678c44258dfe3920497
Fixes Issue 0021967: The value on time fields is changed.

The value on time fields is changed when adding or deleting a row on a subtab of the tab where the fields are located.
But it brings back the original value if refresh is done manually. The GMT correction is not applied correctly in the Grid.
Refreshed the parent records in both form and grid to avoid this.

diff --git a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
@@ -1537,13 +1537,15 @@
       // therefore do an explicit update of the visual components
       if (me.isShowingForm) {
         me.viewForm.refresh();
+        if (me.viewGrid) {
+          me.viewGrid.refreshContents();
+        }
       }
       if (me.viewGrid.data) {
-        var recordIndex = me.viewGrid.getRecordIndex(me.viewGrid.getSelectedRecord());
-        me.viewGrid.data.updateCacheData(data, req);
-        me.viewGrid.selectRecord(me.viewGrid.getRecord(recordIndex));
-        me.viewGrid.refreshRow(recordIndex);
-        me.viewGrid.redraw();
+        me.viewGrid.refreshContents();
+        if (me.viewForm) {
+          me.viewForm.refresh();
+        }
       }
 
 
