Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0004018Openbravo ERP02. Master data managementpublic2008-06-17 13:472008-12-12 17:51
malsasua 
cromero 
normalmajoralways
closedfixed 
5
2.35 
2.35MP10 
Core
No
0004018: ad_column_identifier don't work in c_location with locations without region selected
In this locations, function returns null.

The problem is in function ad_column_identifier_ref_sql because it return wrong sql.
The sql returned is :
SELECT COALESCE(TO_CHAR(T.Address1), ' ')||' - '||
       COALESCE(TO_CHAR(T.Address2), ' ')||' - '||
       COALESCE(TO_CHAR(T.Postal), ' ')||' - '||
       COALESCE(TO_CHAR(T.City), ' ')||' - '||
       (SELECT COALESCE(TO_CHAR(TT.Name), ' ')
        FROM C_Region TT
        WHERE TT.C_Region_ID=T.C_Region_ID) ||' - '||
      (SELECT (SELECT COALESCE(TO_CHAR(MAX(TTT.Name)), TO_CHAR(TT.Name))
               FROM C_Country_Trl TTT
               WHERE TTT.C_Country_ID=TT.C_Country_ID
               AND TTT.AD_LANGUAGE=L.AD_LANGUAGE)
      FROM C_Country TT
      WHERE TT.C_Country_ID=T.C_Country_ID) ||' - '||
      COALESCE(TO_CHAR(T.IsActive), ' ') AS COLUMN_IDENTIFIER
FROM (SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE AD_LANGUAGE='es_ES') L, C_Location T
WHERE C_Location_Id=:c_ID

A example of correct sql is:
SELECT TO_CHAR(COALESCE(TO_CHAR(T.Address1),''))||' - '|| TO_CHAR(COALESCE(TO_CHAR(T.Address2),''))||' - '|| TO_CHAR(COALESCE(TO_CHAR(T.Postal),''))||' - '|| TO_CHAR(COALESCE(TO_CHAR(T.City),''))||' - '||
CASE WHEN (SELECT COALESCE(TO_CHAR(TT.Name), ' ')
           FROM C_Region TT WHERE TT.C_Region_ID=T.C_Region_ID)
     IS NULL THEN
           ' '
     ELSE (SELECT COALESCE(TO_CHAR(TT.Name), ' ')
            FROM C_Region TT WHERE TT.C_Region_ID=T.C_Region_ID) END ||' - ' || (SELECT (SELECT COALESCE(TO_CHAR(MAX(TTT.Name)), TO_CHAR(TT.Name))
 FROM C_Country_Trl TTT
 WHERE TTT.C_Country_ID=TT.C_Country_ID
 AND TTT.AD_LANGUAGE=L.AD_LANGUAGE)
FROM C_Country TT WHERE TT.C_Country_ID=T.C_Country_ID)
||' - '||TO_CHAR(COALESCE(TO_CHAR(T.IsActive),'')) AS COLUMN_IDENTIFIER
FROM (SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE AD_LANGUAGE=:c_language) L, C_Location T WHERE C_Location_ID=:c_ID



PostgreSQL
blocks defect 00039492.40 closed cromero ad_column_identifier don't work in c_location with locations without region selected 
Issue History
2008-06-17 13:47cromeroNew Issue
2008-06-17 13:47cromeroAssigned To => cromero
2008-06-17 13:47cromeroStatusnew => scheduled
2008-06-17 14:17svnbotCheckin
2008-06-17 14:17svnbotNote Added: 0007796
2008-06-17 14:17svnbotStatusscheduled => resolved
2008-06-17 14:17svnbotResolutionopen => fixed
2008-06-17 14:17svnbotsvn_revision => 5104
2008-06-23 23:26cromeroFixed in Version => 2.35MP6
2008-06-24 17:02plujanTag Attached: PostgreSQL
2008-12-12 17:51psarobeRegression testing => No
2008-12-12 17:51psarobeStatusresolved => closed

Notes
(0007796)
svnbot   
2008-06-17 14:17   
Repository: openbravo
Revision: 5104
Author: cromeroherrero
Date: 2008-06-17 14:17:43 +0200 (Tue, 17 Jun 2008)

Fixed bug 4018: ad_column_identifier don't work in c_location with locations without region selected
Added needed COALESCE

---
U branches/r2.3x/src-wad/src/org/openbravo/wad/Wad.java
---

https://dev.openbravo.com/websvn/openbravo/?rev=5104&sc=1 [^]