Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029241Openbravo ERPA. Platformpublic2015-03-11 11:222015-03-17 08:48
AugustoMauch 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
3.0PR15Q2 
alostale
Core
No
0029241: can't filter by Attribute Set Value in Return P&E windows
In Return from Customer P&E it is not possible to filter by Attribute Set Value.

When the Attribute Set Value filter drop down list is opened, no items are displayed and a NPE is logged in openbravo.log:
867f0e26 3132367 [http-8080-3] ERROR org.openbravo.service.datasource.DataSourceServlet -
java.lang.NullPointerException
    at org.openbravo.service.datasource.HQLDataSourceService.getData(HQLDataSourceService.java:185)
    at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetchJSONObject(ReadOnlyDataSourceService.java:137)
    at org.openbravo.service.datasource.ReadOnlyDataSourceService.fetch(ReadOnlyDataSourceService.java:70)
    at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet.java:261)
    at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:747)
-Open Return from customer
-Create a header
-Open Pick/Edit lines
-Select a line and select for that line a Return reason
-Done
-Open Pick/Edit lines
-Open Attribute Set Value filter drop down
  -> ERROR:
     * no items are shown
     * error is logged in openbravo.log

Same is reproducible in Return to Vendor
No tags attached.
caused by defect 00284323.0PR15Q1 closed AugustoMauch can't filter product FK drop down in return windows P&E 
related to defect 0029224 closed AugustoMauch can't filter by Return Reason in Return P&E windows 
related to defect 00314543.0PR16Q2 closed caristu Not possible to filter by Attribute Set Value in Return From Customer pick/edit lines 
Issue History
2015-03-11 11:22AugustoMauchNew Issue
2015-03-11 11:22AugustoMauchAssigned To => AugustoMauch
2015-03-11 11:22AugustoMauchModules => Core
2015-03-11 11:22AugustoMauchTriggers an Emergency Pack => No
2015-03-11 11:23AugustoMauchRelationship addedrelated to 0029224
2015-03-11 11:24AugustoMauchIssue Monitored: alostale
2015-03-11 11:26AugustoMauchRelationship addedcaused by 0028432
2015-03-11 13:34AugustoMauchStatusnew => acknowledged
2015-03-16 09:51AugustoMauchStatusacknowledged => scheduled
2015-03-16 09:51AugustoMauchReview Assigned To => alostale
2015-03-16 10:05AugustoMauchNote Added: 0075607
2015-03-16 10:05AugustoMauchStatusscheduled => resolved
2015-03-16 10:05AugustoMauchFixed in Version => 3.0PR15Q2
2015-03-16 10:05AugustoMauchFixed in SCM revision => https://code.openbravo.com/erp/devel/pi/rev/f906f479f709 [^]
2015-03-16 10:05AugustoMauchResolutionopen => fixed
2015-03-16 10:06AugustoMauchNote Edited: 0075607bug_revision_view_page.php?bugnote_id=0075607#r7971
2015-03-17 08:48alostaleNote Added: 0075674
2015-03-17 08:48alostaleStatusresolved => closed
2015-12-21 11:23alostaleRelationship addedrelated to 0031454

Notes
(0075607)
AugustoMauch   
2015-03-16 10:05   
(edited on: 2015-03-16 10:06)
Fixes issue 29224: Filters work properly in Return from/to P&E window default tip
author Augusto Mauch <augusto.mauch@openbravo.com>
Wed Mar 11 11:07:30 2015 +0100 (4 days ago)
changeset 26182 f906f479f709
parent 26181 35265c987291
Fixes issue 29224: Filters work properly in Return from/to P&E window
URL: https://code.openbravo.com/erp/devel/pi/rev/f906f479f709 [^]

The problem was that in this changeset [1] the way the distinct queries (done to populate the fk filter dropdowns) was modified. The query is different, and the way to process its results too. The change done in the result processing caused this issue. The query done to populate the Attribute Set Value drop down is the following:

select distinct attributeSetValue,attributeSetValue.description FROM MaterialMgmtShipmentInOutLine as iol left join iol.attributeSetValue as attributeSetValue join iol.shipmentReceipt as io where io.businessPartner.id = 'A6750F0D15334FB890C254369AC750A8' and io.processed = true and io.documentStatus <> 'VO' and io.salesTransaction = true and (select iol.salesOrderLine.orderDiscount from MaterialMgmtShipmentInOutLine as e where e.id = iol) is null and iol.client.id in ('0', '23C59575B9CF467C9620760EB255B389') AND iol.organization in ('E443A31992CB4635AFCAEABE7183CE85','0','19404EAD144C49A0AF37D54377CF452D','B843C30461EA4501935CB1D125C9C25A') AND (io.movementDate >= (now() - 90) or (case when (select ('Y') from OrderLine as ol where ol.salesOrder.id = 'F0D6700E7BD6499FA76C6D94014714E8' and ol.goodsShipmentLine = iol) is null then false else true end) = true) ORDER BY attributeSetValue.description

And this is the result returned in the test I did:

1 42EA0E631BDD4ED69D8C30723A5E81C8 [identifier: L582, entity: AttributeSetInstance], L582
2 NULL, NULL

With the previous way of processing the results the second record was ignored, but with the new one a NPE was being thrown.

[1] https://code.openbravo.com/erp/devel/pi/rev/95dd177fbbc7f18d448b3e31cc12b67dbc0cb87d [^]

(0075674)
alostale   
2015-03-17 08:48   
code reviewed.

tested both in Return from Customer and Return to Vendor:
-Attribute Set Value can be filtered when there are lines with value in that field
-Attribute Set Value can be filtered when there are no lines with value in that field