Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0004377Openbravo ERP07. Sales managementpublic2008-07-11 11:582008-09-03 22:58
stefanbader 
iperdomo 
normalmajoralways
closedfixed 
30Ubuntu, SUSE
pi 
2.40 
No
Core
No
0004377: Error when selecting sales order line in the grid view
The behaviour is strange. I cannot reproduce it by a specific rule. Normally this error appears pretty fast, when changing the current selection of the sales order line in the grid view. Sometimes you have to move out of the window and try again to force it. The same error appears also on other windows with 'lines'. It can take some seconds until the message appears after changing the selection. I would be happy to give you a better explanation, but that's all I have.
1. Login with Openbravo,
2. Change to Openbravo Admin, Big Bazaar
3. Sales Management / Sales Order : Select Sales Order 50020
4. Show lines for the sales in order in the grid view
5. Change the current selected line, from 10 to 20 and back, maybe you have to repeat this step, until the following error appears in the log file :

javax.servlet.ServletException: @CODE=0@ERROR: column "c_orderline.line" must appear in the GROUP BY clause or be used in an aggregate function
    at org.openbravo.erpCommon.utility.ExecuteQuery.select(ExecuteQuery.java:190)
    at org.openbravo.erpCommon.utility.DataGrid.getColumnTotals(DataGrid.java:345)
    at org.openbravo.erpCommon.utility.DataGrid.doPost(DataGrid.java:87)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:102)
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:259)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:27)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619)
No tags attached.
Issue History
2008-07-11 11:58stefanbaderNew Issue
2008-07-11 11:58stefanbaderAssigned To => cromero
2008-07-11 11:58stefanbadersf_bug_id0 => 2015870
2008-07-11 18:15cromeroNote Added: 0008284
2008-07-11 18:16cromeroStatusnew => scheduled
2008-07-11 18:16cromeroAssigned Tocromero => iperdomo
2008-07-11 18:16cromerofix_in_branch => trunk
2008-07-13 13:59stefanbaderIssue Monitored: stefanbader
2008-07-17 10:33svnbotCheckin
2008-07-17 10:33svnbotNote Added: 0008310
2008-07-17 10:33svnbotStatusscheduled => resolved
2008-07-17 10:33svnbotResolutionopen => fixed
2008-07-17 10:33svnbotsvn_revision => 5885
2008-07-17 10:43iperdomoNote Added: 0008311
2008-09-03 22:58psarobeRegression testing => No
2008-09-03 22:58psarobeStatusresolved => closed
2008-09-03 22:58psarobeFixed in Version => 2.40

Notes
(0008284)
cromero   
2008-07-11 18:15   
The problem is in this SQL:
2008-07-11 16:16:01 CEST ERROR: la columna "c_orderline.line" debe aparecer en la cláusula GROUP BY o ser usada en una función de agregación
2008-07-11 16:16:01 CEST SENTENCIA: SELECT SUM(Line) AS TOTAL
        FROM C_OrderLine
        left join (SELECT M_Product_ID, Name FROM M_Product) td0 on C_OrderLine.M_Product_ID = td0.M_Product_ID

        left join (SELECT C_UOM_ID, Name FROM C_UOM) td1 on C_OrderLine.C_UOM_ID = td1.C_UOM_ID

        left join (SELECT AD_Language, C_UOM_ID, Name FROM C_UOM_Trl) td_trl2 on td1.C_UOM_ID = td_trl2.C_UOM_ID AND td_trl2.AD_Language = $1
        left join (SELECT C_Tax_ID, Name FROM C_Tax) td3 on C_OrderLine.C_Tax_ID = td3.C_Tax_ID
        left join (SELECT AD_Language, C_Tax_ID, Name FROM C_Tax_Trl) td_trl4 on td3.C_Tax_ID = td_trl4.C_Tax_ID AND td_trl4.AD_Language = $2
        WHERE (C_OrderLine.C_OrderLine_ID) IN (SELECT C_OrderLine.C_OrderLine_ID
         FROM C_OrderLine
         WHERE C_OrderLine.AD_Client_ID IN (0,1000000)
         AND C_OrderLine.AD_Org_ID IN (0,1000000,1000002,1000003,1000004,1000005,1000006,1000008,1000009,1000007)
         AND C_OrderLine.C_Order_ID = $3
         AND C_OrderLine.C_OrderLine_ID IN ('1000043')
        )
        ORDER BY C_OrderLine.Line ASC, C_OrderLine.C_OrderLine_ID
(0008310)
svnbot   
2008-07-17 10:33   
Repository: openbravo
Revision: 5885
Author: iperdomo
Date: 2008-07-17 10:33:31 +0200 (Thu, 17 Jul 2008)

Fixes bug 4377: Removed order by clause when calculating the total of a column

---
U trunk/src/org/openbravo/erpCommon/utility/DataGrid.java
U trunk/src/org/openbravo/erpCommon/utility/ModelSQLGeneration.java
U trunk/src/org/openbravo/erpCommon/utility/TableSQLData.java
---

https://dev.openbravo.com/websvn/openbravo/?rev=5885&sc=1 [^]
(0008311)
iperdomo   
2008-07-17 10:43   
To reproduce the bug, you select one or more rows from the grid, and then put the mouse pointer over the column header. This action will calculate the sum of the selected rows and place it on the window status bar.

Note: To be able to see the result, you have to configure your browser. By default, changing the status bar message is disabled [1]

[1] http://developer.mozilla.org/en/docs/DOM:window.status [^]