fixed bug 34797: 3.0 selector as process param don't apply filter expression
authorAsier Lostalé <asier.lostale@openbravo.com>
Fri, 13 Jan 2017 11:47:44 +0100
changeset 31478 4cd8e4f37081
parent 31477 6398d4e21157
child 31479 ec94c6362d99
fixed bug 34797: 3.0 selector as process param don't apply filter expression

When a 3.0 selector is used as parameter within a process (ad_process), filter
expressions it might define were not applied in popup filters.

There were 2 problems in the code:
- Incorrect default assignment using bitwise or operator instead of boolean OR.
- Incorrect retrieval of selector definition id
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js
--- a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js	Fri Jan 13 10:03:39 2017 +0100
+++ b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-widget.js	Fri Jan 13 11:47:44 2017 +0100
@@ -13,7 +13,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2009-2014 Openbravo SLU
+ * All portions are Copyright (C) 2009-2017 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -880,8 +880,8 @@
 
         filterData: function (criteria, callback, requestProperties) {
           requestProperties = requestProperties || {};
-          requestProperties.params = requestProperties.params | {};
-          requestProperties.params._selectorDefinitionId = this.selectorDefinitionId;
+          requestProperties.params = requestProperties.params || {};
+          requestProperties.params._selectorDefinitionId = this.selector.selectorDefinitionId;
           if (!criteria) {
             criteria = {};
           }
@@ -895,7 +895,7 @@
 
           criteria[OB.Constants.TEXT_MATCH_PARAMETER_OVERRIDE] = this.selector.popupTextMatchStyle;
 
-          criteria._selectorDefinitionId = this.selectorDefinitionId;
+          criteria._selectorDefinitionId = this.selector.selectorDefinitionId;
           criteria._requestType = 'Window';
 
           // and call the super
@@ -920,8 +920,8 @@
           criteria._requestType = 'Window';
 
           requestProperties = requestProperties || {};
-          requestProperties.params = requestProperties.params | {};
-          requestProperties.params._selectorDefinitionId = this.selectorDefinitionId;
+          requestProperties.params = requestProperties.params || {};
+          requestProperties.params._selectorDefinitionId = this.selector.selectorDefinitionId;
 
           // and call the super
           return this.Super('fetchData', [criteria, callback, requestProperties]);