fixed issue 13178: Incorrect setting of PO fields
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 19 Jul 2010 09:31:43 +0200
changeset 7893 44c9f0919ecc
parent 7892 b5302813e29a
child 7894 10a6e520f525
child 7897 60bba5a75909
fixed issue 13178: Incorrect setting of PO fields

After modifiying the element trl, the setting for its PO fields was
incorrect, it always used the SO value.

The trigger has been fixed.
src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml
--- a/src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml	Mon Jul 19 00:19:48 2010 +0200
+++ b/src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml	Mon Jul 19 09:31:43 2010 +0200
@@ -17,7 +17,7 @@
 * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
 * All Rights Reserved.
 * Contributor(s): Openbravo SLU
-* Contributions are Copyright (C) 2001-2008 Openbravo, S.L.U.
+* Contributions are Copyright (C) 2001-2010 Openbravo, S.L.U.
 *
 * Specifically, this derivative work is based upon the following Compiere
 * file and version.
@@ -77,6 +77,46 @@
       AND exists (SELECT 1 from ad_module m
               where m.ad_module_id=ad_field.ad_module_id
               and m.isindevelopment='Y');
+
+      -- Field SO
+      UPDATE AD_Field_Trl
+         SET NAME = coalesce(:NEW.PO_NAME, :new.Name),
+             Description = coalesce(:NEW.PO_Description, :new.Description),
+             HELP = coalesce(:NEW.PO_HELP, :new.Help),
+             IsTranslated = :NEW.IsTranslated
+      WHERE  AD_Language = :NEW.AD_Language
+         AND AD_Field_ID IN (
+               SELECT F.AD_Field_ID
+                 FROM AD_Field F, AD_Column C, AD_Module M, 
+                      AD_Tab T, AD_Window w
+                WHERE F.AD_Column_ID = C.AD_Column_ID
+                  AND C.AD_Element_ID = :NEW.AD_Element_ID
+                  AND F.IsCentrallyMaintained = 'Y'
+                  AND M.aD_Module_id = f.ad_module_id
+                  and m.AD_Language != :new.AD_Language
+                  and f.AD_Tab_ID = T.AD_Tab_ID
+                  and w.AD_Window_ID = t.AD_Window_ID
+                  and w.IsSoTrx='N');
+                  
+      UPDATE AD_Field
+         SET NAME = coalesce(:NEW.PO_NAME, :new.Name),
+             Description = coalesce(:NEW.PO_Description, :new.Description), 
+             HELP = coalesce(:NEW.PO_HELP, :new.Help)
+      WHERE  AD_Field_ID IN (
+               SELECT F.AD_Field_ID
+                 FROM AD_Field F, AD_Column C, AD_Module M,
+                      AD_Tab T, AD_Window w
+                WHERE F.AD_Column_ID = C.AD_Column_ID
+                  AND C.AD_Element_ID = :NEW.AD_Element_ID
+                  AND F.IsCentrallyMaintained = 'Y'
+                  AND M.aD_Module_id = f.ad_module_id
+                  and m.AD_Language = :new.AD_Language
+		  and f.AD_Tab_ID = T.AD_Tab_ID
+                  and w.AD_Window_ID = t.AD_Window_ID
+                  and w.IsSoTrx='N')
+      AND exists (SELECT 1 from ad_module m
+              where m.ad_module_id=ad_field.ad_module_id
+              and m.isindevelopment='Y');
                   
        UPDATE AD_Column
     SET Name=:new.Name,