Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029224Openbravo ERPA. Platformpublic2015-03-10 16:202015-03-17 08:47
alostale 
AugustoMauch 
urgentminorhave not tried
closedfixed 
5
 
3.0PR15Q2 
alostale
Core
No
0029224: can't filter by Return Reason in Return P&E windows
In Return from Customer P&E it is not possible to filter by Return Reason

When the Return Reason filter drop down list is opened, no items are displayed and an error is logged in openbravo.log:

867f0e26 2720892 [http-8080-3] ERROR org.openbravo.client.kernel.KernelUtils - java.lang.String cannot be cast to org.openbravo.base.structure.BaseOBObject
java.lang.ClassCastException: java.lang.String cannot be cast to org.openbravo.base.structure.BaseOBObject
    at org.openbravo.service.datasource.HQLDataSourceService.getData(HQLDataSourceService.java:184)
    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 Return Reason filter drop down
  -> ERROR:
     * no items are shown
     * error is logged in openbravo.log

Same is reproducible in Return to Vendor
No tags attached.
related to defect 0029212 closed AugustoMauch can't filter multiple products in return from/to P&Es 
related to defect 0029241 closed AugustoMauch can't filter by Attribute Set Value in Return P&E windows 
caused by defect 00284323.0PR15Q1 closed AugustoMauch can't filter product FK drop down in return windows P&E 
related to defect 0029235 new Triage Omni OMS can't filter by Writeoff in Order/Invoice P&E window 
related to defect 0029239 new Triage Omni OMS can't filter by Returned in Return Orphan Lines P&E window 
Issue History
2015-03-10 16:20alostaleNew Issue
2015-03-10 16:20alostaleAssigned To => AugustoMauch
2015-03-10 16:20alostaleModules => Core
2015-03-10 16:20alostaleTriggers an Emergency Pack => No
2015-03-10 16:21alostaleRelationship addedrelated to 0029212
2015-03-10 16:21alostaleStatusnew => acknowledged
2015-03-10 16:27alostaleRelationship addedrelated to 0029225
2015-03-10 19:17AugustoMauchRegression level => Production - QA Approved
2015-03-10 19:17AugustoMauchRegression date => 2014-12-22
2015-03-10 19:17AugustoMauchRegression introduced in release => 3.0PR15Q1
2015-03-10 19:17AugustoMauchRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/95dd177fbbc7f18d448b3e31cc12b67dbc0cb87d [^]
2015-03-10 19:18AugustoMauchRelationship addedcaused by 0028432
2015-03-11 10:11AugustoMauchRelationship addedrelated to 0029235
2015-03-11 10:34AugustoMauchSummarycan't filter by Return Reason in Return P&E windows => can't filter by Return Reason or Attribute Set Value in Return P&E windows
2015-03-11 10:34AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=7924#r7924
2015-03-11 10:34AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7926#r7926
2015-03-11 10:53AugustoMauchRelationship addedrelated to 0029239
2015-03-11 11:09AugustoMauchStatusacknowledged => scheduled
2015-03-11 11:23AugustoMauchSummarycan't filter by Return Reason or Attribute Set Value in Return P&E windows => can't filter by Return Reason in Return P&E windows
2015-03-11 11:23AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=7929#r7929
2015-03-11 11:23AugustoMauchSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7930#r7930
2015-03-11 11:23AugustoMauchRelationship addedrelated to 0029241
2015-03-11 11:24AugustoMauchIssue Monitored: alostale
2015-03-16 09:34AugustoMauchRegression levelProduction - QA Approved =>
2015-03-16 09:34AugustoMauchRegression date2014-12-22 =>
2015-03-16 09:34AugustoMauchRegression introduced in release3.0PR15Q1 =>
2015-03-16 09:34AugustoMauchRegression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/95dd177fbbc7f18d448b3e31cc12b67dbc0cb87d [^] =>
2015-03-16 09:50AugustoMauchReview Assigned To => alostale
2015-03-16 10:02hgbotCheckin
2015-03-16 10:02hgbotNote Added: 0075605
2015-03-16 10:02hgbotStatusscheduled => resolved
2015-03-16 10:02hgbotResolutionopen => fixed
2015-03-16 10:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/35265c9872911393ff94fa06c04304d9b93a6549 [^]
2015-03-16 10:02hgbotCheckin
2015-03-16 10:02hgbotNote Added: 0075606
2015-03-16 10:02hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/35265c9872911393ff94fa06c04304d9b93a6549 [^] => http://code.openbravo.com/erp/devel/pi/rev/f906f479f7098a1f1f6ab300417650902053f1b8 [^]
2015-03-16 15:57hudsonbotCheckin
2015-03-16 15:57hudsonbotNote Added: 0075631
2015-03-16 15:57hudsonbotCheckin
2015-03-16 15:57hudsonbotNote Added: 0075632
2015-03-17 08:47alostaleNote Added: 0075673
2015-03-17 08:47alostaleStatusresolved => closed
2015-03-17 08:47alostaleFixed in Version => 3.0PR15Q2

Notes
(0075605)
hgbot   
2015-03-16 10:02   
Repository: erp/devel/pi
Changeset: 35265c9872911393ff94fa06c04304d9b93a6549
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Mar 11 11:07:30 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/35265c9872911393ff94fa06c04304d9b93a6549 [^]

Fixes issue 29224: Return reason filter works properly in Return from/to P&E

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 regressi
on was caused because some HQL tables build their distinct queries manually in their HQL transformers, and those queries should have been updated too.

The query was changed the whole BaseOBObject in the first position of the result array, instead of including just its id.

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

---
M src/org/openbravo/common/datasource/ReturnToFromCustomerVendorHQLTransformer.java
M src/org/openbravo/common/datasource/ReturnToFromCustomerVendorOrphanHQLTransformer.java
---
(0075606)
hgbot   
2015-03-16 10:02   
Repository: erp/devel/pi
Changeset: f906f479f7098a1f1f6ab300417650902053f1b8
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Mar 11 11:07:30 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f906f479f7098a1f1f6ab300417650902053f1b8 [^]

Fixes issue 29224: Filters work properly in Return from/to P&E window

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 [^]

---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/HQLDataSourceService.java
---
(0075631)
hudsonbot   
2015-03-16 15:57   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/30bc648fab8b [^]
Maturity status: Test
(0075632)
hudsonbot   
2015-03-16 15:57   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/30bc648fab8b [^]
Maturity status: Test
(0075673)
alostale   
2015-03-17 08:47   
code reviewed.

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