Fixed 11828: Fix synchronization of ad_process_trl -> ad_field_trl
authorStefan Hühner <stefan.huehner@openbravo.com>
Wed, 01 Jun 2011 20:54:49 +0200
changeset 12655 62889a6b8947
parent 12654 3021190cb536
child 12656 d549a87140e1
Fixed 11828: Fix synchronization of ad_process_trl -> ad_field_trl
Trigger supposed to be doing that had a typo prevent proper synchronization.
In addition fixing that, this change also deactivates the check doing the sync
only if some field of the ad_process_trl record really changed to also apply
the fix to existing instances (on next import of translations) even if the value
in ad_process_trl (name, description, ...) does not change.
src-db/database/model/triggers/AD_PROCESS_TRL_TRG.xml
--- a/src-db/database/model/triggers/AD_PROCESS_TRL_TRG.xml	Wed Jun 01 19:35:16 2011 +0200
+++ b/src-db/database/model/triggers/AD_PROCESS_TRL_TRG.xml	Wed Jun 01 20:54:49 2011 +0200
@@ -34,14 +34,6 @@
 
   IF UPDATING
   THEN
-    IF (   COALESCE (:OLD.NAME, '.') <> COALESCE (:NEW.NAME, '.')
-        OR COALESCE (:OLD.Description, '.') <>
-                                              COALESCE (:NEW.Description, '.')
-        OR COALESCE (:OLD.HELP, '.') <> COALESCE (:NEW.HELP, '.')
-        OR COALESCE (:OLD.IsTranslated, '.') <>
-                                             COALESCE (:NEW.IsTranslated, '.')
-       )
-    THEN
       UPDATE AD_Field_Trl
          SET NAME = :NEW.NAME,
              Description = :NEW.Description,
@@ -56,7 +48,7 @@
                   AND C.AD_Process_ID = :NEW.AD_Process_ID
                   AND F.IsCentrallyMaintained = 'Y'
                   and m.ad_module_id = f.ad_module_id
-                  and m.ad_language = :new.ad_language);
+                  and m.ad_language <> :new.ad_language);
                   
       UPDATE AD_Field f
          SET NAME = :NEW.NAME,
@@ -73,7 +65,6 @@
                   and m.ad_language = :new.ad_language);
                   
      --column cannot be updated because of mutating tables
-    END IF;
   END IF;
 END AD_PROCESS_TRL_TRG
 ]]></body>