IDEMPIERE-255 Items in sort tabs are not translated / peer review and fix

This commit is contained in:
Carlos Ruiz 2012-05-30 12:52:42 -05:00
parent 41bbbc5b6a
commit 01821ee9a7
5 changed files with 90 additions and 8 deletions

View File

@ -43,9 +43,28 @@ UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=5769
UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=6274
;
UPDATE ad_printformatitem_trl
SET NAME = ( SELECT COALESCE(et.name, pf.name)
FROM ad_printformatitem pf
LEFT JOIN ad_column c ON pf.ad_column_id=c.ad_column_id
LEFT JOIN ad_element_trl et ON et.ad_element_id=c.ad_element_id AND et.ad_language=ad_printformatitem_trl.ad_language
WHERE pf.ad_printformatitem_id=ad_printformatitem_trl.ad_printformatitem_id);
-- May 30, 2012 12:15:59 PM COT
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2012-05-30 12:15:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200192
;
-- May 30, 2012 12:16:02 PM COT
ALTER TABLE AD_PrintFormatItem_Trl MODIFY Name NVARCHAR2(60)
;
-- May 30, 2012 12:16:02 PM COT
ALTER TABLE AD_PrintFormatItem_Trl MODIFY Name NOT NULL
;
UPDATE AD_System
SET LastMigrationScriptApplied='840_IDEMPIERE-255.sql'
WHERE LastMigrationScriptApplied<'840_IDEMPIERE-255.sql'
SET LastMigrationScriptApplied='845_IDEMPIERE-255.sql'
WHERE LastMigrationScriptApplied<'845_IDEMPIERE-255.sql'
OR LastMigrationScriptApplied IS NULL
;

View File

@ -43,8 +43,28 @@ UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=5769
UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=6274
;
UPDATE ad_printformatitem_trl
SET NAME = ( SELECT COALESCE(et.name, pf.name)
FROM ad_printformatitem pf
LEFT JOIN ad_column c ON pf.ad_column_id=c.ad_column_id
LEFT JOIN ad_element_trl et ON et.ad_element_id=c.ad_element_id AND et.ad_language=ad_printformatitem_trl.ad_language
WHERE pf.ad_printformatitem_id=ad_printformatitem_trl.ad_printformatitem_id);
-- May 30, 2012 12:15:59 PM COT
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2012-05-30 12:15:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200192
;
-- May 30, 2012 12:16:02 PM COT
INSERT INTO t_alter_column values('ad_printformatitem_trl','Name','VARCHAR(60)',null,null)
;
-- May 30, 2012 12:16:02 PM COT
INSERT INTO t_alter_column values('ad_printformatitem_trl','Name',null,'NOT NULL',null)
;
UPDATE AD_System
SET LastMigrationScriptApplied='840_IDEMPIERE-255.sql'
WHERE LastMigrationScriptApplied<'840_IDEMPIERE-255.sql'
SET LastMigrationScriptApplied='845_IDEMPIERE-255.sql'
WHERE LastMigrationScriptApplied<'845_IDEMPIERE-255.sql'
OR LastMigrationScriptApplied IS NULL
;

View File

@ -572,6 +572,19 @@ UPDATE AD_PRINTFORMATITEM pfi
WHERE ad_client_id = pfi.ad_client_id
AND ismultilingualdocument = 'Y');
UPDATE AD_PRINTFORMATITEM_TRL trl
SET Name = (SELECT e.Name FROM AD_ELEMENT_TRL e, AD_COLUMN c, AD_PRINTFORMATITEM p
WHERE e.AD_LANGUAGE=trl.AD_LANGUAGE AND e.AD_Element_ID=c.AD_Element_ID
AND c.AD_Column_ID=p.AD_Column_ID AND p.AD_PrintFormatItem_ID=trl.AD_PrintFormatItem_ID),
Updated = now()
WHERE EXISTS (SELECT 1 FROM AD_PRINTFORMATITEM p, AD_ELEMENT_TRL e, AD_COLUMN c
WHERE trl.AD_PrintFormatItem_ID=p.AD_PrintFormatItem_ID
AND p.AD_Column_ID=c.AD_Column_ID
AND c.AD_Element_ID=e.AD_Element_ID AND c.AD_Process_ID IS NULL
AND trl.AD_LANGUAGE=e.AD_LANGUAGE
AND p.IsCentrallyMaintained='Y' AND p.IsActive='Y'
AND (trl.Name <> e.Name));
UPDATE AD_PRINTFORMATITEM_TRL trl
SET printname =
(SELECT e.printname

View File

@ -636,6 +636,19 @@ UPDATE AD_PRINTFORMATITEM
WHERE ad_client_id = AD_PRINTFORMATITEM.ad_client_id
AND ismultilingualdocument = 'Y');
UPDATE AD_PRINTFORMATITEM_TRL trl
SET Name = (SELECT e.Name FROM AD_ELEMENT_TRL e, AD_COLUMN c, AD_PRINTFORMATITEM p
WHERE e.AD_LANGUAGE=trl.AD_LANGUAGE AND e.AD_Element_ID=c.AD_Element_ID
AND c.AD_Column_ID=p.AD_Column_ID AND p.AD_PrintFormatItem_ID=trl.AD_PrintFormatItem_ID),
Updated = now()
WHERE EXISTS (SELECT 1 FROM AD_PRINTFORMATITEM p, AD_ELEMENT_TRL e, AD_COLUMN c
WHERE trl.AD_PrintFormatItem_ID=p.AD_PrintFormatItem_ID
AND p.AD_Column_ID=c.AD_Column_ID
AND c.AD_Element_ID=e.AD_Element_ID AND c.AD_Process_ID IS NULL
AND trl.AD_LANGUAGE=e.AD_LANGUAGE
AND p.IsCentrallyMaintained='Y' AND p.IsActive='Y'
AND (trl.Name <> e.Name));
UPDATE AD_PRINTFORMATITEM_TRL
SET printname =
(SELECT e.printname

View File

@ -509,9 +509,26 @@ public class SynchronizeTerminology extends SvrProcess
log.info(" rows updated: "+no);
trx.commit(true);
log.info("Synchronize PrintFormatItem Trl Name from Element");
sql="UPDATE AD_PRINTFORMATITEM_TRL trl"
+" SET Name = (SELECT e.Name FROM AD_ELEMENT_TRL e, AD_COLUMN c, AD_PRINTFORMATITEM p"
+" WHERE e.AD_LANGUAGE=trl.AD_LANGUAGE AND e.AD_Element_ID=c.AD_Element_ID "
+" AND c.AD_Column_ID=p.AD_Column_ID AND p.AD_PrintFormatItem_ID=trl.AD_PrintFormatItem_ID),"
+" Updated = SYSDATE"
+" WHERE EXISTS (SELECT 1 FROM AD_PRINTFORMATITEM p, AD_ELEMENT_TRL e, AD_COLUMN c"
+" WHERE trl.AD_PrintFormatItem_ID=p.AD_PrintFormatItem_ID"
+" AND p.AD_Column_ID=c.AD_Column_ID"
+" AND c.AD_Element_ID=e.AD_Element_ID AND c.AD_Process_ID IS NULL"
+" AND trl.AD_LANGUAGE=e.AD_LANGUAGE"
+" AND p.IsCentrallyMaintained='Y' AND p.IsActive='Y'"
+" AND (trl.Name <> e.Name))";
no = DB.executeUpdate(sql, false, get_TrxName());
log.info(" rows updated: "+no);
trx.commit(true);
log.info("Synchronize PrintFormatItem Trl from Element Trl (Multi-Lingual)");
sql="UPDATE AD_PRINTFORMATITEM_TRL trl"
+" SET (PrintName, Name) = (SELECT e.PrintName, e.Name" // idempiere 255
+" SET PrintName = (SELECT e.PrintName"
+" FROM AD_ELEMENT_TRL e, AD_COLUMN c, AD_PRINTFORMATITEM pfi"
+" WHERE e.AD_LANGUAGE=trl.AD_LANGUAGE"
+" AND e.AD_Element_ID=c.AD_Element_ID"
@ -536,7 +553,7 @@ public class SynchronizeTerminology extends SvrProcess
log.info("Synchronize PrintFormatItem Trl (Not Multi-Lingual)");
sql="UPDATE AD_PRINTFORMATITEM_TRL trl"
+" SET (PrintName, Name) = (SELECT pfi.PrintName, pfi.Name" // idempiere 255
+" SET PrintName = (SELECT pfi.PrintName"
+" FROM AD_PRINTFORMATITEM pfi"
+" WHERE pfi.AD_PrintFormatItem_ID=trl.AD_PrintFormatItem_ID)"
+" WHERE EXISTS (SELECT 1 "