fixed bug
22645: tabs without explicit reference to parent id are not refreshed
The problem was as the subtab was not explicitly setting its parent record (it
was done through where clause), when changing selection in parent an empty
criteria was created preventing request to datasource of being done.
The fix creates for this case a dummy criteria to force request to be triggered.
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Fri Jan 25 15:26:55 2013 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Fri Jan 25 18:55:48 2013 +0100
@@ -11,7 +11,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) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -1873,6 +1873,25 @@
}
}
+ if (this.view.parentView && !this.view.parentProperty) {
+ // subtabs without an explicit reference to their parent property
+ // result in an empty criteria which is ignored not generating the
+ // request. Forcing load
+ // See issue #22645
+ selectedValues = this.view.parentView.viewGrid.getSelectedRecords();
+ if (selectedValues.length !== 1) {
+ // if there is not a single record selected, always false criterion
+ criteria.criteria.push({
+ fieldName: 'id',
+ operator: 'equals',
+ value: '-1'
+ });
+ } else {
+ // with a single record selected, dummy criterion
+ criteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
+ }
+ }
+
this.checkShowFilterFunnelIcon(criteria);
return criteria;