details: https://code.openbravo.com/erp/devel/pi/rev/2a79f597da83
changeset: 33650:2a79f597da83
user: Asier Lostalé <asier.lostale <at> openbravo.com>
date: Wed Mar 07 12:40:14 2018 +0100
summary: fixed bug 38061: isSoTrx filter expression doesn't work from Process
Definition
When using OB.isSalesTransaction in a filter expression for a selector used in
a process definition it failed.
The problem was caused because in this case window information was not sent to
SelectorDefaultFilterActionHandler.
The fix includes:
* Covering this case to send window id
* OBBindings.isSalesTransaction not to throw NPE in case window is not set
* Send this information as part of the POST payload rather than in the query
string
* Don't send duplicated information in request query string and payload to
SelectorDefaultFilterActionHandler, do it only as payload
diffstat:
modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java
| 8 +++++++-
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
| 5 ++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diffs (40 lines):
diff -r 918e4d163290 -r 2a79f597da83
modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java
---
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java
Wed Mar 07 14:36:19 2018 +0000
+++
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java
Wed Mar 07 12:40:14 2018 +0100
@@ -137,9 +137,15 @@
return "Y".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value);
}
+ String windowId = getWindowId();
+ if (windowId == null) {
+ return null;
+ }
+
ApplicationDictionaryCachedStructures adcs = WeldUtils
.getInstanceFromStaticBeanManager(ApplicationDictionaryCachedStructures.class);
- Window w = adcs.getWindow(getWindowId());
+
+ Window w = adcs.getWindow(windowId);
if (w != null) {
return w.isSalesTransaction();
}
diff -r 918e4d163290 -r 2a79f597da83
modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
---
a/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
Wed Mar 07 14:36:19 2018 +0000
+++
b/modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
Wed Mar 07 12:40:14 2018 +0100
@@ -393,12 +393,15 @@
isc.addProperties(data, this.view.getUnderLyingRecordContext(false,
true));
} else if (this.view && this.view.sourceView &&
this.view.sourceView.getContextInfo) {
isc.addProperties(data, this.view.sourceView.getContextInfo(false,
true));
+ } else if (this.selector && this.selector.view &&
this.selector.view.getUnderLyingRecordContext) {
+ // selector in a param window
+ isc.addProperties(data,
this.selector.view.getUnderLyingRecordContext(false, true, null,
this.selector.isComboReference));
}
callback = function (resp, data, req) {
selectorWindow.fetchDefaultsCallback(resp, data, req);
};
-
OB.RemoteCallManager.call('org.openbravo.userinterface.selector.SelectorDefaultFilterActionHandler',
data, data, callback);
+
OB.RemoteCallManager.call('org.openbravo.userinterface.selector.SelectorDefaultFilterActionHandler',
data, null, callback);
},
fetchDefaultsCallback: function (rpcResponse, data, rpcRequest) {
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits