Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029447Openbravo ERP04. Warehouse managementpublic2014-10-13 11:322015-04-10 10:08
AugustoMauch 
reinaldoguerra 
immediateminorhave not tried
closedfixed 
5
 
3.0PR15Q1.33.0PR15Q1.3 
umartirena
Core
Production - Confirmed Stable
2014-02-20
3.0PR14Q2
https://code.openbravo.com/erp/devel/pi/rev/0b033ca5bd1b08e81a30cfdbab2b459549d8c17c [^]
No
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(StockReservationPickAndEditDataSource.java:702)
    at org.openbravo.common.datasource.StockReservationPickAndEditDataSource.getGridData(StockReservationPickAndEditDataSource.java:560)
    at org.openbravo.common.datasource.StockReservationPickAndEditDataSource.getData(StockReservationPickAndEditDataSource.java:130)
    at org.openbravo.common.datasource.StockReservationPickAndEditDataSource.fetchJSONObject(StockReservationPickAndEditDataSource.java:102)
    at org.openbravo.common.datasource.StockReservationPickAndEditDataSource.fetch(StockReservationPickAndEditDataSource.java:82)
    at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet.java:261)
    at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:744)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:449)
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:92)
    at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:63)
    at org.openbravo.service.datasource.DataSourceServlet.service(DataSourceServlet.java:140)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.client.kernel.KernelFilter$1.doAction(KernelFilter.java:62)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.client.kernel.KernelFilter.doFilter(KernelFilter.java:71)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:701)
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.
Approved
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 revisionhttp://code.openbravo.com/erp/devel/pi/rev/4f00f31f65e1024bf0a9e985297f8bef5746b68f [^] => http://code.openbravo.com/erp/backports/3.0PR15Q1.3/rev/9a563be5f58d3772b4bcd1be275cab2a6d506243 [^]
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

Notes
(0076411)
hgbot   
2015-04-09 12:44   
Repository: erp/backports/3.0PR15Q1.3
Changeset: 9a563be5f58d3772b4bcd1be275cab2a6d506243
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Thu Apr 09 12:26:23 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q1.3/rev/9a563be5f58d3772b4bcd1be275cab2a6d506243 [^]

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 @MaterialMgmtReservation.id@. 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 @MaterialMgmtReservation.id@ 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/StockReservationPickAndEditDataSource.java
---
(0076416)
umartirena   
2015-04-09 12:45   
(edited on: 2015-04-09 12:46)
Code Review + Testing OK

Issue fixed by Reinaldo Guerra