Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0003949Openbravo ERP02. Master data managementpublic2008-06-12 17:012008-07-01 17:56
malsasua 
cromero 
normalmajoralways
closedout of date 
5
2.35 
2.40 
Core
No
0003949: 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



No tags attached.
depends on backport 0004018 closed cromero ad_column_identifier don't work in c_location with locations without region selected 
? Wad.java (174,140) 2008-06-17 08:53
https://issues.openbravo.com/file_download.php?file_id=83&type=bug
Issue History
2008-06-12 17:01malsasuaNew Issue
2008-06-12 17:01malsasuaAssigned To => cromero
2008-06-16 10:43psarobeStatusnew => scheduled
2008-06-16 10:43psarobeNote Added: 0007724
2008-06-16 19:02cromeroNote Added: 0007747
2008-06-17 08:53malsasuaFile Added: Wad.java
2008-06-17 08:55malsasuaNote Added: 0007757
2008-06-17 13:47cromeroTarget Version => 2.40
2008-06-17 13:47cromeroStatusscheduled => feedback
2008-06-17 13:47cromeroStatusfeedback => scheduled
2008-06-17 14:18cromeroStatusscheduled => closed
2008-06-17 14:18cromeroNote Added: 0007797
2008-06-17 14:18cromeroResolutionopen => out of date
2008-07-01 17:56anonymoussf_bug_id0 => 2007951

Notes
(0007724)
psarobe   
2008-06-16 10:43   
As a workaround and better solution it exists several stored functions (c_location_name, c_location_description, c_location_identifier)
(0007747)
cromero   
2008-06-16 19:02   
Reminder sent to: malsasua

Could you attach the wad.java final file ?
(0007757)
malsasua   
2008-06-17 08:55   
done.
thanks
(0007797)
cromero   
2008-06-17 14:18   
This functionality works perfectly in the trunk, but not in the 2.3x branch.

A backport has been created for it.