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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0004890
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] 00. Application dictionaryminoralways2008-09-09 17:162008-12-11 13:40
ReporterrafarodaView Statuspublic 
Assigned Torafaroda 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branch2.40Fixed in SCM revision7109
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabasePostgreSQLJava version1.5
OS VersionUbuntu 7.10Database version8.3Ant version1.7
Product VersionpiSCM revision7008 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0004890: AD_COLUMN_IDENTIFIER does not work correctly for 'M_Product' table

DescriptionIn some files [1] [2] [3], AD_COLUMN_IDENTIFIER is used, for instance, as:
AD_COLUMN_IDENTIFIER(TO_CHAR('M_Product'), TO_CHAR(T.M_PRODUCT_ID), TO_CHAR('es_ES')) in order to get the name of a product in Spanish, if this product has a translation to Spanish.

[1] https://dev.openbravo.com/websvn/openbravo/trunk/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java [^]
[2] https://dev.openbravo.com/websvn/openbravo/trunk/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR.java [^]
[3] https://dev.openbravo.com/websvn/openbravo/trunk/src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesJR.java [^]
Steps To Reproduce1) Set a Spanish translation for the product with M_Product_Id = 1000001 (Telephone) inside 'Master Data Management || Product || Product >> Translation'

2) Execute (being 1000001 the ID of the product - M_Product_Id):
select AD_COLUMN_IDENTIFIER('M_Product', '1000001', 'es_ES') from dual;

You still get the name 'Telephone' in 'en_US'.
Proposed SolutionIf you inspect AD_COLUMN_IDENTIFIER function, you find:
SELECT REPLACE(REPLACE(SQL_RECORD_IDENTIFIER, ':c_language', '''' || p_Language || ''''), ':c_ID', p_Record_ID)
  INTO v_SQL
  FROM AD_TABLE
  WHERE UPPER(TABLENAME)=UPPER(p_TableName) ;

If you execute:
SELECT REPLACE(REPLACE(SQL_RECORD_IDENTIFIER, ':c_language', '''' || 'es_ES' || ''''), ':c_ID', '1000001')
  FROM AD_TABLE
  WHERE UPPER(TABLENAME)=UPPER('M_Product') ;

You get the SQL:
SELECT TO_CHAR(COALESCE(TO_CHAR(T.Name),'')) AS COLUMN_IDENTIFIER FROM (SELECT AD_LANGUAGE FROM AD_LANGUAGE WHERE AD_LANGUAGE='es_ES') L, M_Product T WHERE M_Product_ID='1000001'

Then, inside AD_COLUMN_IDENTIFIER function, this SQL sentence is executed. You can notice that there is no reference to M_Product_Trl table so you will never get the Spanish translation of the product.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0004864 closedrafaroda AD_COLUMN_IDENTIFIER does not work correctly for 'M_Product' table 

-  Notes
(0008954)
svnbot (reporter)
2008-09-09 17:36

Repository: openbravo
Revision: 7109
Author: rafaroda
Date: 2008-09-09 17:36:04 +0200 (Tue, 09 Sep 2008)

Fixes bug 0004890 Changed to 'Y' the value 'Translation' of 'Name' column inside 'M_Product' table then run 'ad_update_table_identifier(null)' procedure.

---
U branches/r2.40/src-db/database/sourcedata/AD_COLUMN.xml
U branches/r2.40/src-db/database/sourcedata/AD_TABLE.xml
---

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

- Issue History
Date Modified Username Field Change
2008-09-09 17:16 rafaroda New Issue
2008-09-09 17:16 rafaroda Assigned To => rafaroda
2008-09-09 17:16 rafaroda Status new => scheduled
2008-09-09 17:36 svnbot Checkin
2008-09-09 17:36 svnbot Note Added: 0008954
2008-09-09 17:36 svnbot Status scheduled => resolved
2008-09-09 17:36 svnbot Resolution open => fixed
2008-09-09 17:36 svnbot svn_revision => 7109
2008-12-11 13:40 psarobe Regression testing => No
2008-12-11 13:40 psarobe Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker