Fixes issue 17063: Sales invoice: Create lines from is not working well
authorMartin Taal <martin.taal@openbravo.com>
Tue, 10 May 2011 22:22:59 +0200
changeset 12086 0472100cf1c8
parent 12085 2045cb1d1e25
child 12087 38276e5dee09
Fixes issue 17063: Sales invoice: Create lines from is not working well
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js	Tue May 10 18:52:45 2011 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js	Tue May 10 22:22:59 2011 +0200
@@ -1023,15 +1023,17 @@
     var tabViewPane = null;
     
     // refresh the tabs
-    if (this.childTabSet && differentRecordId) {
+    if (this.childTabSet && (differentRecordId || !this.isOpenDirectModeParent)) {
       for (var i = 0; i < this.childTabSet.tabs.length; i++) {
         tabViewPane = this.childTabSet.tabs[i].pane;
         
-        if (!selectedRecordId || selectedRecordId !== tabViewPane.parentRecordId) {
+        if (!selectedRecordId || !this.isOpenDirectModeParent || selectedRecordId !== tabViewPane.parentRecordId) {
           tabViewPane.doRefreshContents(true); 
         }
       }
     }
+    delete this.isOpenDirectModeParent;
+    
     // and recompute the count:
     this.updateChildCount();
   },
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js	Tue May 10 18:52:45 2011 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js	Tue May 10 22:22:59 2011 +0200
@@ -548,6 +548,8 @@
         this.view.parentRecordId = this.data.get(0)[this.view.parentProperty];
 
         this.view.parentView.viewGrid.isOpenDirectMode = true;
+        // makes sure that the parent refresh will not fire back to cause a child refresh
+        this.view.parentView.isOpenDirectModeParent = true;
         // prevents opening edit mode for parent views
         this.view.parentView.viewGrid.isOpenDirectModeParent = true;
         this.view.parentView.viewGrid.targetRecordId = this.view.parentRecordId;