details:   https://code.openbravo.com/erp/devel/pi/rev/74e62c9cbec5
changeset: 15519:74e62c9cbec5
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Fri Feb 17 11:10:34 2012 +0100
summary:   Fixes issue 19740: Tabs sharing entity with saved parent are 
refreshed

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     |   3 +
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 |  17 ++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diffs (40 lines):

diff -r 410d00339f44 -r 74e62c9cbec5 
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
     Thu Feb 16 12:41:10 2012 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Fri Feb 17 11:10:34 2012 +0100
@@ -1439,6 +1439,9 @@
         form.setNewState(false);
 
         view.refreshParentRecord();
+        // Refreshes the child views that belong to the same entity
+        // as the view being saved
+        view.refreshChildViewsWithEntity(this.view.entity);
 
         // We fill attachments in case the record is new, so that components
         // of the attachments section are created
diff -r 410d00339f44 -r 74e62c9cbec5 
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
 Thu Feb 16 12:41:10 2012 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Fri Feb 17 11:10:34 2012 +0100
@@ -837,6 +837,23 @@
     }
   },
 
+  refreshChildViewsWithEntity: function (entity) {
+    var i, length, tabViewPane;
+    if (entity && this.childTabSet) {
+      length = this.childTabSet.tabs.length;
+      for (i = 0; i < length; i++) {
+        tabViewPane = this.childTabSet.tabs[i].pane;
+        // if the view belong to the input entity, it is refreshed
+        // See https://issues.openbravo.com/view.php?id=18951
+        if (tabViewPane && tabViewPane.entity === entity) {
+          tabViewPane.doRefreshContents(true);
+        }
+        // Refresh the child views of these tab
+        tabViewPane.refreshChildViewsWithEntity(entity);
+      }
+    }
+  },
+
   shouldOpenDefaultEditMode: function () {
     // can open default edit mode if defaultEditMode is set
     // and this is the root view or a child view with a selected parent.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to