Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029447Openbravo ERP04. Warehouse managementpublic2014-10-13 11:322015-04-10 10:08
immediateminorhave not tried
Production - Confirmed Stable
3.0PR14Q2 [^]
0029447: Not possible to select more than one value in fk filter drop down on Manage Stock
In the pick and execute window of Manage Stock it is not possible to select two records in the filter drop down of the foreign key columns. Selecting one value works, but if two are selected no values are returned and this exception is shown in the log:

java.lang.ClassCastException: org.codehaus.jettison.json.JSONArray cannot be cast to org.codehaus.jettison.json.JSONObject
    at org.openbravo.common.datasource.StockReservationPickAndEditDataSource.getFilteredAttribute(
    at org.openbravo.common.datasource.StockReservationPickAndEditDataSource.getGridData(
    at org.openbravo.common.datasource.StockReservationPickAndEditDataSource.getData(
    at org.openbravo.common.datasource.StockReservationPickAndEditDataSource.fetchJSONObject(
    at org.openbravo.common.datasource.StockReservationPickAndEditDataSource.fetch(
    at org.openbravo.service.datasource.DataSourceServlet.doFetch(
    at org.openbravo.service.datasource.DataSourceServlet.doPost(
    at javax.servlet.http.HttpServlet.service(
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(
    at org.openbravo.client.kernel.BaseKernelServlet.service(
    at org.openbravo.service.datasource.DataSourceServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    at org.openbravo.utils.SessionExpirationFilter.doFilter(
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    at org.openbravo.utils.CharsetFilter.doFilter(
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    at org.openbravo.client.kernel.KernelFilter$1.doAction(
    at org.openbravo.client.kernel.KernelFilter.doFilter(
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(
    at org.openbravo.dal.core.DalRequestFilter.doFilter(
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    at org.apache.catalina.core.StandardWrapperValve.invoke(
    at org.apache.catalina.core.StandardContextValve.invoke(
    at org.apache.catalina.core.StandardHostValve.invoke(
    at org.apache.catalina.valves.ErrorReportValve.invoke(
    at org.apache.catalina.core.StandardEngineValve.invoke(
    at org.apache.catalina.connector.CoyoteAdapter.service(
    at org.apache.coyote.http11.Http11Processor.process(
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Login as group admin:
1. Go to preference window and set the preference Enable Stock Reservations = Y
2. Go to Stock Reservation window and create a new record:
Org= F&B España - Región Norte
Product= Zumo de Naranja Bio 0,33L
Qty= 10
Warehouse= España Región Norte
3. Click on Manage Stock. A P&E is shown with several records.
4. Select several values in the Attribute Set Value filter drop down. No records will be returned.
blocks defect 0027848 closed reinaldoguerra Not possible to select more than one value in fk filter drop down on Manage Stock 
Issue History
2015-03-27 14:48aferrazTypedefect => backport
2015-03-27 14:48aferrazTarget Version => 3.0PR15Q1.3
2015-04-09 12:44hgbotCheckin
2015-04-09 12:44hgbotNote Added: 0076411
2015-04-09 12:44hgbotStatusscheduled => resolved
2015-04-09 12:44hgbotResolutionopen => fixed
2015-04-09 12:44hgbotFixed in SCM revision [^] => [^]
2015-04-09 12:45umartirenaReview Assigned Toaferraz => umartirena
2015-04-09 12:45umartirenaNote Added: 0076416
2015-04-09 12:45umartirenaStatusresolved => closed
2015-04-09 12:45umartirenaFixed in Version => 3.0PR15Q1.3
2015-04-09 12:46umartirenaNote Edited: 0076416bug_revision_view_page.php?bugnote_id=0076416#r8214
2015-04-10 10:08dmitry_mezentsevTag Attached: Approved

2015-04-09 12:44   
Repository: erp/backports/3.0PR15Q1.3
Changeset: 9a563be5f58d3772b4bcd1be275cab2a6d506243
Author: Unai Martirena <unai.martirena <at>>
Date: Thu Apr 09 12:26:23 2015 +0200
URL: [^]

Fixes bug 29448, Fixes bug 29447, Fixes bug 29449

The following changes was made in Stock Reservation pick and edit:
When filters are executed, a Reservation entity is created from the json parameter This works fine when the pop-up is called from Stock Reservation window, but from Sales Order, this parameter does not exists, and the filter process fails. Now is included a code line that puts a into the json parameters before the filters are applied.
Array critera filtering was bad created when getting grid's data, so was changed, to allow filter's multiple selection.
An hibernate exception is launched when typing wrong filters and the expression 'in ()' is included in the query to be executed. So this expression was replaced by one which returns a false value: '1 = 2'
Were included also, changes to allow filtering quantity's column. Other changes were included to avoid exceptions comparing to null values.

M src/org/openbravo/common/datasource/
2015-04-09 12:45   
(edited on: 2015-04-09 12:46)
Code Review + Testing OK

Issue fixed by Reinaldo Guerra