Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0038061
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2018-03-06 17:502018-03-13 17:24
ReportervmromanosView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR18Q2
StatusclosedFix in branchFixed in SCM revision2a79f597da83
ProjectionnoneETAnoneTarget Version3.0PR18Q2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0038061: Selector filter expression with OB.isSalesTransaction() doesn't work when called from a Process Definition

DescriptionThe "On Hand Locator" reference has the following filter expression:

"((" + OB.isSalesTransaction() + " [...]

When the selector is inside a normal tab it's working fine, however when the selector is included into a Process Definition the following error is printed into the log:

1823852 [http-apr-8080-exec-10] ERROR org.openbravo.userinterface.selector.SelectorDefaultFilterActionHandler - Error generating Default Filter action result: id to load is required for loading
java.lang.IllegalArgumentException: id to load is required for loading
    at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:89)
    at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:61)
    at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1002)
    at org.openbravo.dal.core.SessionHandler.find(SessionHandler.java:534)
    at org.openbravo.dal.core.SessionHandler.find(SessionHandler.java:500)
    at org.openbravo.dal.service.OBDal.get(OBDal.java:353)
    at org.openbravo.client.application.window.ApplicationDictionaryCachedStructures.getWindow(ApplicationDictionaryCachedStructures.java:170)
    at org.openbravo.client.application.window.ApplicationDictionaryCachedStructures$Proxy$_$$_WeldClientProxy.getWindow(ApplicationDictionaryCachedStructures$Proxy$_$$_WeldClientProxy.java)
    at org.openbravo.client.application.OBBindings.isSalesTransaction(OBBindings.java:142)
    at jdk.nashorn.internal.scripts.Script$5$\^eval\_.:program(<eval>:1)
    at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
    at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
    at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
    at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
    at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
    at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
    at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
    at org.openbravo.base.expression.OBScriptEngine.eval(OBScriptEngine.java:57)
    at org.openbravo.userinterface.selector.SelectorDefaultFilterActionHandler.execute(SelectorDefaultFilterActionHandler.java:152)
    at org.openbravo.client.kernel.BaseActionHandler.execute(BaseActionHandler.java:73)
    at org.openbravo.userinterface.selector.SelectorDefaultFilterActionHandler$Proxy$_$$_WeldClientProxy.execute(SelectorDefaultFilterActionHandler$Proxy$_$$_WeldClientProxy.java)
    at org.openbravo.client.kernel.KernelServlet.processActionRequest(KernelServlet.java:314)
    at org.openbravo.client.kernel.KernelServlet.doGet(KernelServlet.java:206)
    at org.openbravo.client.kernel.KernelServlet.doPost(KernelServlet.java:287)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:221)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:462)
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:87)
    at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:58)
    at org.openbravo.client.kernel.KernelServlet.service(KernelServlet.java:168)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    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:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:83)
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46)
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:105)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2522)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2511)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)





After debugging I have realized the problem is OBBindings.getWindowId() method, which returns NULL when the selector is defined into a Process Definition.
Later on the OBBindings.isSalesTransaction() method throws the NPE because it tries to recover a window with NULL ad_window_id.
Steps To ReproduceIn a recent PI.
As F&B Admin:

Go to Referenced Inventory Type window and create any record for US org
Go to Referenced Inventory window and create any record for West org linked to previous Referenced Inventory Type
Press Box button.
In the process definition, press the storage bin selector's magnifying glass button.
Check the openbravo.log for the exception
Proposed SolutionEnsure the selector receives the window from which it was called even when inside a Process Definition called from a window.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 00378273.0PR18Q2 closedvmromanos Referenced Inventory 
related to defect 0027529 closedAugustoMauch Parameter Windows should use the context of its owner tab to initialize the parameters 
related to defect 0037437 closedalostale useless session cache of window.isSOTrx 
related to defect 00380393.0PR18Q2 closedjarmendariz Organization filtering issues in Process Definition selectors 
causes defect 0038548 closedcaristu Default Expression in Selector Field does not work properly 

-  Notes
(0103066)
hgbot (developer)
2018-03-07 17:27

Repository: erp/devel/pi
Changeset: 2a79f597da83870d152ee3176ffa679a01ac19d5
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Mar 07 12:40:14 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/2a79f597da83870d152ee3176ffa679a01ac19d5 [^]

fixed bug 38061: isSoTrx filter expression doesn't work from Process Definition

  When using OB.isSalesTransaction in a filter expression for a selector used in
  a process definition it failed.

  The problem was caused because in this case window information was not sent to
  SelectorDefaultFilterActionHandler.

  The fix includes:
   * Covering this case to send window id
   * OBBindings.isSalesTransaction not to throw NPE in case window is not set
   * Send this information as part of the POST payload rather than in the query string
   * Don't send duplicated information in request query string and payload to
     SelectorDefaultFilterActionHandler, do it only as payload

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java
M modules/org.openbravo.userinterface.selector/web/org.openbravo.userinterface.selector/js/ob-selector-item.js
---
(0103095)
hudsonbot (developer)
2018-03-08 16:51

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/bce7d98857dd [^]
Maturity status: Test
(0103160)
hgbot (developer)
2018-03-12 14:00

Repository: erp/devel/pi
Changeset: f8144ae28d38e4d274846ce852667652e7397287
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Mar 12 14:00:10 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f8144ae28d38e4d274846ce852667652e7397287 [^]

related to issue 38061: add javadoc information

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java
---
(0103161)
hgbot (developer)
2018-03-12 14:11

Repository: erp/devel/pi
Changeset: 447278fc8b1cc3fe39fb3f0b0b2bb9845e0eda01
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Mar 12 14:08:21 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/447278fc8b1cc3fe39fb3f0b0b2bb9845e0eda01 [^]

related to bug 38061: don't get windowId|ISSOTRX attribute if windowId is null

  Micro-optimization: if the windowId is null, then do not try to retrieve the windowId|ISSOTRX attribute and return null immediately.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java
---
(0103164)
caristu (developer)
2018-03-12 16:23

Code reviewed + tested OK.
(0103212)
hudsonbot (developer)
2018-03-13 17:24

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/1d3ccc92fab6 [^]
Maturity status: Test
(0103213)
hudsonbot (developer)
2018-03-13 17:24

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/1d3ccc92fab6 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2018-03-06 17:50 vmromanos New Issue
2018-03-06 17:50 vmromanos Assigned To => platform
2018-03-06 17:50 vmromanos Modules => Core
2018-03-06 17:50 vmromanos Triggers an Emergency Pack => No
2018-03-06 17:51 vmromanos Target Version => 3.0PR18Q2
2018-03-06 17:52 vmromanos Relationship added related to 0037827
2018-03-06 17:54 vmromanos Summary Selector filter expression with OB.isSalesTransaction() doesn't work => Selector filter expression with OB.isSalesTransaction() doesn't work when called from a Process Definition
2018-03-06 17:54 vmromanos Description Updated View Revisions
2018-03-06 17:54 vmromanos Steps to Reproduce Updated View Revisions
2018-03-07 12:35 alostale Relationship added related to 0027529
2018-03-07 12:35 alostale Relationship added related to 0037437
2018-03-07 12:36 alostale Relationship added related to 0038039
2018-03-07 17:27 hgbot Checkin
2018-03-07 17:27 hgbot Note Added: 0103066
2018-03-07 17:27 hgbot Status new => resolved
2018-03-07 17:27 hgbot Resolution open => fixed
2018-03-07 17:27 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/2a79f597da83870d152ee3176ffa679a01ac19d5 [^]
2018-03-07 17:27 alostale Assigned To platform => alostale
2018-03-07 17:28 alostale Review Assigned To => caristu
2018-03-08 16:51 hudsonbot Checkin
2018-03-08 16:51 hudsonbot Note Added: 0103095
2018-03-12 14:00 hgbot Checkin
2018-03-12 14:01 hgbot Note Added: 0103160
2018-03-12 14:11 hgbot Checkin
2018-03-12 14:13 hgbot Note Added: 0103161
2018-03-12 16:24 caristu Note Added: 0103164
2018-03-12 16:24 caristu Status resolved => closed
2018-03-12 16:24 caristu Fixed in Version => 3.0PR18Q2
2018-03-13 17:24 hudsonbot Checkin
2018-03-13 17:24 hudsonbot Note Added: 0103212
2018-03-13 17:24 hudsonbot Checkin
2018-03-13 17:24 hudsonbot Note Added: 0103213
2018-05-14 18:58 AtulOpenbravo Relationship added causes 0038548


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker