details:   /erp/devel/pi/rev/e3cdfb6a481f
changeset: 11806:e3cdfb6a481f
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Fri Apr 29 12:27:59 2011 +0200
summary:   Fixes issue 16930: Filters by default are cleared in transactional 
windows after completing a document

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
 |  16 +++++++--
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (47 lines):

diff -r 38523b042486 -r e3cdfb6a481f 
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-view-grid.js
  Fri Apr 29 12:23:04 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
  Fri Apr 29 12:27:59 2011 +0200
@@ -570,6 +570,8 @@
   refreshGrid: function(callback){
     if (this.getSelectedRecord()) {
       this.targetRecordId = this.getSelectedRecord()[OB.Constants.ID];
+      // as the record is already selected it is already in the filter
+      this.notRemoveFilter = true;
     }
     this.actionAfterDataArrived = callback;
     this.invalidateCache();
@@ -584,6 +586,8 @@
     if (this.body) {
       // don't need it anymore
       delete this.targetRecordId;
+      delete this.notRemoveFilter;
+
       var gridRecord = data.find(OB.Constants.ID, tmpTargetRecordId);
       
       // no grid record found, stop here
@@ -741,8 +745,10 @@
       // add a dummy criteria to force a fetch
       criteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
       
-      // remove the filter clause we don't want to use
-      this.filterClause = null;
+      if (!this.notRemoveFilter) {
+        // remove the filter clause we don't want to use it anymore
+        this.filterClause = null;
+      }
     } else {
       // remove the _dummy
       for (i = 0; i < criteria.criteria.length; i++) {
@@ -820,8 +826,10 @@
     
     if (this.targetRecordId) {
       params._targetRecordId = this.targetRecordId;
-      // remove the filter clause we don't want to use it anymore
-      this.filterClause = null;
+      if (!this.notRemoveFilter) {
+        // remove the filter clause we don't want to use it anymore
+        this.filterClause = null;
+      }
     }
 
     // prevent the count operation

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to