details: https://code.openbravo.com/erp/devel/pi/rev/74017a22fc13
changeset: 32609:74017a22fc13
user: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
date: Thu Aug 31 11:22:01 2017 +0200
summary: Fixed issue 36598: Multirecord Process sets only one organization in
parameters
A standard process can be defined as multi record process to be able to execute
it for more than one
record. In this case it can be selected records belonging to different
organizations. The reported
problem was that in this situation it was take into account only the first
organization sending it
as "_org" parameter.
This problem has been fixed by managing this situation properly. Now, when a
multirecord process is
launched and more than one record is selected, the natural tree of writable
organizations of the
current context is calculated instead of the natural tree of the first
organization of the first
selected record.
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
| 13 +++++++--
1 files changed, 10 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r f8c3d0a4f7a4 -r 74017a22fc13
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
Fri Aug 11 16:21:42 2017 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
Thu Aug 31 11:22:01 2017 +0200
@@ -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) 2011-2016 Openbravo SLU
+ * All portions are Copyright (C) 2011-2017 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -177,7 +177,9 @@
// include in the request the values of the parameters of the
parameter window
isc.addProperties(dsRequest.params, me.view.theForm.getValues());
}
- dsRequest.params[OB.Constants.ORG_PARAMETER] = me.getOrgParameter();
+ if (!dsRequest.params[OB.Constants.CALCULATE_ORGS]) {
+ dsRequest.params[OB.Constants.ORG_PARAMETER] = me.getOrgParameter();
+ }
// Add to the params the tabId of the P&E window
if (me.viewProperties && me.viewProperties.tabId) {
dsRequest.params.tabId = me.viewProperties.tabId;
@@ -779,7 +781,12 @@
isc.addProperties(params, view.getContextInfo(true, false));
}
- params[OB.Constants.ORG_PARAMETER] = this.getOrgParameter();
+ // When more than one record is selected, _org parameter is not valid
because the records could have had different orgs
+ if (view && view.lastRecordSelectedCount > 1) {
+ params[OB.Constants.CALCULATE_ORGS] = true;
+ } else {
+ params[OB.Constants.ORG_PARAMETER] = this.getOrgParameter();
+ }
if (this.orderByClause) {
params[OB.Constants.ORDERBY_PARAMETER] = this.orderByClause;
------------------------------------------------------------------------------
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