details:   https://code.openbravo.com/erp/devel/pi/rev/07891c3b09b7
changeset: 19638:07891c3b09b7
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Mon Feb 11 17:10:03 2013 +0100
summary:   Fixes issue 23001: Clearing the filter works properly in P&E windows

The problem was that if in a P&E window the user entered something in a filter 
and then deleted that filter, the application considered that there were no 
filter active, so clearing the filter did not even try to call the datasource. 
The problem is that even though there were no filter, that window had a filter 
clause that needs to be cleared if the user clicks on the Clear Filter button.

This has been fixed by forcing a reload when the user clicks on the Clear 
Filter button by adding a dummy criterion to the criteria.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
 |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (25 lines):

diff -r eb1fd311615f -r 07891c3b09b7 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
      Mon Feb 11 16:53:14 2013 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
      Mon Feb 11 17:10:03 2013 +0100
@@ -276,6 +276,11 @@
       crit = criteria;
     }
 
+    if (this._cleaningFilter) {
+      // Always refresh when cleaning the filter
+      criteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
+    }
+
     this.Super('handleFilterEditorSubmit', [crit, context]);
   },
 
@@ -356,7 +361,9 @@
 
   clearFilter: function () {
     this.filterClause = null;
+    this._cleaningFilter = true;
     this.Super('clearFilter', arguments);
+    delete this._cleaningFilter;
   },
 
   getFetchRequestParams: function (params) {

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to