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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0004681
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementminoralways2008-08-22 12:042009-02-18 18:44
ReporterdalsasuaView Statuspublic 
Assigned Topheenan 
PrioritynormalResolutionduplicateFixed in Version
StatusclosedFix in branchpiFixed in SCM revision
ProjectionnoneETAnoneTarget Version2.35
OSLinux 32 bitDatabasePostgreSQLJava versiontecnicia14
OS Versionubuntu hardyDatabase versiontecnicia14Ant versiontecnicia14
Product Version2.35SCM revision6486 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0004681: Prepaid sales orders crashes when completing in postgres

DescriptionOn r2.35 branch, rev. 6486, prepaid sales orders crashes when completing in postgres
Steps To ReproduceCreate a prepaid sales order, add a line, and press complete.

11:44:16 [ajp-8009-5] ERROR org.openbravo.erpCommon.utility.ExecuteQuery - SQL error in query: SELECT SUM(Line) AS TOTAL
FROM C_OrderLine
left join (SELECT M_Product_ID, Name FROM M_Product) td1 on C_OrderLine.M_Product_ID = td1.M_Product_ID
 
left join (SELECT C_UOM_ID, Name FROM C_UOM) td2 on C_OrderLine.C_UOM_ID = td2.C_UOM_ID
 
left join (SELECT AD_Language, C_UOM_ID, Name FROM C_UOM_Trl) td_trl3 on td2.C_UOM_ID = td_trl3.C_UOM_ID AND td_trl3.AD_Language = ?
left join (SELECT C_Tax_ID, Name FROM C_Tax) td4 on C_OrderLine.C_Tax_ID = td4.C_Tax_ID
left join (SELECT AD_Language, C_Tax_ID, Name FROM C_Tax_Trl) td_trl5 on td4.C_Tax_ID = td_trl5.C_Tax_ID AND td_trl5.AD_Language = ?
WHERE C_OrderLine.AD_Client_ID IN (0,1000000)
AND C_OrderLine.AD_Org_ID IN (0,1000000)
AND C_OrderLine.C_Order_ID = ?
AND C_OrderLine.C_OrderLine_ID IN ('1000066')
ORDER BY C_OrderLine.Line ASC, C_OrderLine.C_OrderLine_IDException:org.postgresql.util.PSQLException: ERROR: column "c_orderline.line" must appear in the GROUP BY clause or be used in an aggregate function
TagsPostgreSQL
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
duplicate of defect 0007262 closedAinhoaPagola User not able to complete the Sales order with document type as 'Prepay' 

-  Notes
(0008890)
cromero (reporter)
2008-09-05 11:45

The problem in PostgreSQL is that we are trying to catch a code exception 'DATA_EXCEPTION' when we should use 'RAISE_EXCEPTION'

''RAISE EXCEPTION presently always generates the same SQLSTATE code, P0001, no matter what message it is invoked with. It is possible to trap this exception with EXCEPTION ... WHEN RAISE_EXCEPTION THEN ... but there is no way to tell one RAISE from another.''

So, now we are using exceptions like NO_DATA_FOUND (Oracle) that it is translated to DATA_EXCEPTION (PostgreSQL), but it does not work since we are trying to catch an exception code that is never thrown.

What we should do in Postgres would be something like:
RAISE EXCEPTION '%', 'ORACLE_EXCEPTION_CODE';
EXCEPTION WHEN RAISE_EXCEPTION THEN --OBTG:ORACLE_EXCEPTION_CODE --
(0010156)
rafaroda (developer)
2008-11-11 11:59

This bug still reproduces in the trunk. It seems to be an odd behavior in the messaging of C_OrderPOST1 procedure [1]. See lines 175-177 (in the XML file):

IF (v_DocSubTypeSO='PR' AND v_invoicerule <> 'I') THEN
   RAISE_APPLICATION_ERROR(-20000, '@PrepayMustImmediate@');
END IF;

[1] https://dev.openbravo.com/websvn/openbravo/trunk/src-db/database/model/functions/C_ORDER_POST1.xml [^]

- Issue History
Date Modified Username Field Change
2008-08-22 12:04 dalsasua New Issue
2008-08-22 12:04 dalsasua Assigned To => cromero
2008-08-22 12:04 dalsasua sf_bug_id 0 => 2067129
2008-08-22 12:04 dalsasua Regression testing => No
2008-09-01 12:25 psarobe Status new => scheduled
2008-09-01 12:25 psarobe fix_in_branch => trunk
2008-09-03 18:25 cromero Status scheduled => feedback
2008-09-03 18:25 cromero Status feedback => scheduled
2008-09-05 11:25 cromero Tag Attached: PostgreSQL
2008-09-05 11:45 cromero Note Added: 0008890
2008-09-05 11:45 cromero Assigned To cromero => marvintm
2008-11-05 13:35 cromero Assigned To marvintm => AinhoaPagola
2008-11-05 13:36 cromero Status scheduled => closed
2008-11-05 13:36 cromero Resolution open => unable to reproduce
2008-11-11 11:59 rafaroda Assigned To AinhoaPagola => gorkaion
2008-11-11 11:59 rafaroda Status closed => new
2008-11-11 11:59 rafaroda Resolution unable to reproduce => open
2008-11-11 11:59 rafaroda Note Added: 0010156
2008-11-11 12:00 rafaroda Status new => scheduled
2008-11-25 17:02 rafaroda Assigned To gorkaion => Dowid
2008-12-09 14:30 PavelPonomarev Assigned To Dowid => pheenan
2009-02-18 18:44 AinhoaPagola Relationship added duplicate of 0007262
2009-02-18 18:44 AinhoaPagola Status scheduled => closed
2009-02-18 18:44 AinhoaPagola Duplicate ID 0 => 7262
2009-02-18 18:44 AinhoaPagola Resolution open => duplicate


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker