Openbravo Issue Tracking System - Openbravo ERP | |||||||||||||||||||
View Issue Details | |||||||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||||||
0036598 | Openbravo ERP | A. Platform | public | 2017-08-04 09:35 | 2017-09-21 16:49 | ||||||||||||||
Reporter | vmromanos | ||||||||||||||||||
Assigned To | inigosanchez | ||||||||||||||||||
Priority | urgent | Severity | major | Reproducibility | always | ||||||||||||||
Status | closed | Resolution | fixed | ||||||||||||||||
Platform | OS | 5 | OS Version | ||||||||||||||||
Product Version | |||||||||||||||||||
Target Version | 3.0PR17Q4 | Fixed in Version | 3.0PR17Q4 | ||||||||||||||||
Merge Request Status | |||||||||||||||||||
Review Assigned To | caristu | ||||||||||||||||||
OBNetwork customer | |||||||||||||||||||
Web browser | |||||||||||||||||||
Modules | Core | ||||||||||||||||||
Support ticket | |||||||||||||||||||
Regression level | |||||||||||||||||||
Regression date | |||||||||||||||||||
Regression introduced in release | |||||||||||||||||||
Regression introduced by commit | |||||||||||||||||||
Triggers an Emergency Pack | No | ||||||||||||||||||
Summary | 0036598: Process Definition for multirecord sets only one organization in filter parameters | ||||||||||||||||||
Description | A Process Definition is defined to work with multirecords. In this case you can select records belonging to different organizations. However, when the records are submitted to the server, a unique parameter "_org=" is sent as filter. Then the server detects it and tries to get the natural tree for this organization. When you have selected records belonging to different trees, the records belonging to a different natural tree of the "_org" parameter are filtered out. | ||||||||||||||||||
Steps To Reproduce | Create a Process Definition for multirecord and standard ui. Add a grid that shows Sales Invoices Create a button in Sales Invoice window and link it to the process definition In the onload function for the Process Definition add a similar code, replacing the necessary lines (mainly function name and grid name): OB.OBAWO.onLoad = function (view) { var selection, paramGrid, parentGrid, criteria, gridCriteria; parentGrid = view.parentWindow.view.viewGrid; selection = parentGrid.getSelectedRecords(); paramGrid = view.theForm.getItem('stock').canvas.viewGrid; criteria = []; selection.forEach(function (r) { criteria.push({ fieldName: 'id', operator: 'equals', value: r.id }); }); gridCriteria = { operator: 'or', _constructor: 'AdvancedCriteria', criteria: criteria }; paramGrid.dataSource.requestProperties.params.criteria = gridCriteria; }; The idea is to select some records in Sales Invoice window, press the Process Definition button, and display only those records in the new popup grid. In Sales Invoice window select 2 records, one for Norte and the other for Sur. Press the Process Definition button. Verify just one record is shown. Close the popup. Repeat the selection, but this time selecting several records from the same org. Verify all the records are now shown in the new grid. Set a break point in AdvancedQueryBuilder.java, addWhereOrgParameters method. And repeat the process. Verify filterparameters contains a parameter _org with any of the organizations, that is used to add the natural tree filter. Example (in my case I work with storage details): {@MaterialMgmtStorageDetail.storageBin@=4B413455BCE541C0AB80E18BFD7247B5, @MaterialMgmtStorageDetail.client@=A64C68776B544B0DB59C16456C43E608, @MaterialMgmtStorageDetail.product@=110D54D3A4214D3095008EC8F35D88B5, @MaterialMgmtStorageDetail.id@=DBB2E952074E47A5B4377B4115F03F02, whereAndFilterClause=e.qtyPutAway>0, @MaterialMgmtStorageDetail.organization@=3FF21930C89F4A8FAC60E7264BF96568, @MaterialMgmtStorageDetail.uOM@=100, _org=3FF21930C89F4A8FAC60E7264BF96568, @MaterialMgmtStorageDetail.attributeSetValue@=0} | ||||||||||||||||||
Proposed Solution | When selecting multiple records, it would be better to set the JsonConstants.CALCULATE_ORGS parameter instead so we enter by the second if: if (filterParameters.containsKey(JsonConstants.ORG_PARAMETER)) { final String value = filterParameters.get(JsonConstants.ORG_PARAMETER); if (entity.isOrganizationEnabled() && value != null && value.length() > 0) { orgs = OBContext.getOBContext().getOrganizationStructureProvider().getNaturalTree(value); orgPart = buildOrgPartWhereClause(orgs); } localWhereClause = buildLocalWhereClause(localWhereClause, orgPart); } else if (filterParameters.containsKey(JsonConstants.CALCULATE_ORGS)) { // add natural tree of writable organizations final Set<String> orgsWritables = OBContext.getOBContext().getWritableOrganizations(); for (final String o : orgsWritables) { orgs.addAll(OBContext.getOBContext().getOrganizationStructureProvider().getNaturalTree(o)); } orgPart = buildOrgPartWhereClause(orgs); localWhereClause = buildLocalWhereClause(localWhereClause, orgPart); } | ||||||||||||||||||
Additional Information | |||||||||||||||||||
Tags | No tags attached. | ||||||||||||||||||
Relationships |
| ||||||||||||||||||
Attached Files | |||||||||||||||||||
Issue History | |||||||||||||||||||
Date Modified | Username | Field | Change | ||||||||||||||||
2017-08-04 09:35 | vmromanos | New Issue | |||||||||||||||||
2017-08-04 09:35 | vmromanos | Assigned To | => platform | ||||||||||||||||
2017-08-04 09:35 | vmromanos | Modules | => Core | ||||||||||||||||
2017-08-04 09:35 | vmromanos | Triggers an Emergency Pack | => No | ||||||||||||||||
2017-08-04 09:36 | vmromanos | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=15592#r15592 | ||||||||||||||||
2017-08-04 09:36 | vmromanos | Proposed Solution updated | |||||||||||||||||
2017-08-04 09:46 | alostale | Priority | high => urgent | ||||||||||||||||
2017-08-04 09:46 | alostale | Status | new => acknowledged | ||||||||||||||||
2017-08-10 10:21 | alostale | Relationship added | related to 0036151 | ||||||||||||||||
2017-08-18 13:56 | inigosanchez | Assigned To | platform => inigosanchez | ||||||||||||||||
2017-08-18 13:56 | inigosanchez | Status | acknowledged => scheduled | ||||||||||||||||
2017-08-18 13:56 | inigosanchez | Status | scheduled => feedback | ||||||||||||||||
2017-08-24 13:46 | inigosanchez | Status | feedback => scheduled | ||||||||||||||||
2017-08-30 12:50 | inigosanchez | Relationship added | related to 0035124 | ||||||||||||||||
2017-08-31 11:24 | hgbot | Checkin | |||||||||||||||||
2017-08-31 11:24 | hgbot | Note Added: 0098749 | |||||||||||||||||
2017-08-31 11:24 | hgbot | Status | scheduled => resolved | ||||||||||||||||
2017-08-31 11:24 | hgbot | Resolution | open => fixed | ||||||||||||||||
2017-08-31 11:24 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/74017a22fc13565b4f2988a87fffc17fae151cf6 [^] | ||||||||||||||||
2017-08-31 11:26 | inigosanchez | Review Assigned To | => alostale | ||||||||||||||||
2017-09-01 09:09 | alostale | Note Added: 0098768 | |||||||||||||||||
2017-09-01 09:09 | alostale | Status | resolved => new | ||||||||||||||||
2017-09-01 09:09 | alostale | Resolution | fixed => open | ||||||||||||||||
2017-09-01 10:27 | inigosanchez | Status | new => scheduled | ||||||||||||||||
2017-09-04 10:01 | hgbot | Checkin | |||||||||||||||||
2017-09-04 10:01 | hgbot | Note Added: 0098792 | |||||||||||||||||
2017-09-04 10:02 | inigosanchez | Status | scheduled => resolved | ||||||||||||||||
2017-09-04 10:02 | inigosanchez | Fixed in Version | => 3.0PR17Q4 | ||||||||||||||||
2017-09-04 10:02 | inigosanchez | Resolution | open => fixed | ||||||||||||||||
2017-09-11 17:13 | caristu | Review Assigned To | alostale => caristu | ||||||||||||||||
2017-09-18 12:20 | caristu | Note Added: 0099103 | |||||||||||||||||
2017-09-18 12:20 | caristu | Status | resolved => closed | ||||||||||||||||
2017-09-21 16:49 | hudsonbot | Checkin | |||||||||||||||||
2017-09-21 16:49 | hudsonbot | Note Added: 0099350 | |||||||||||||||||
2017-09-21 16:49 | hudsonbot | Checkin | |||||||||||||||||
2017-09-21 16:49 | hudsonbot | Note Added: 0099353 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|