details:   /erp/devel/pi/rev/44c9f0919ecc
changeset: 7893:44c9f0919ecc
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Mon Jul 19 09:31:43 2010 +0200
summary:   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.

diffstat:

 src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml |  42 ++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diffs (59 lines):

diff -r b5302813e29a -r 44c9f0919ecc 
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,

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to