Fixes issue 19492: The user can change the header organization in project window,
authorIoritz Cia <ioritz.cia@openbravo.com>
Wed, 29 Feb 2012 13:03:59 +0100
changeset 15667 7be373a943ba
parent 15666 05feefc7fd97
child 15668 62eb2ad3d760
Fixes issue 19492: The user can change the header organization in project window,
when the project has lines.
src-db/database/model/triggers/C_PROJECTPHASE_TRG.xml
src-db/database/model/triggers/C_PROJECT_TRG.xml
src-db/database/sourcedata/AD_FIELD.xml
--- a/src-db/database/model/triggers/C_PROJECTPHASE_TRG.xml	Wed Feb 29 16:38:17 2012 +0100
+++ b/src-db/database/model/triggers/C_PROJECTPHASE_TRG.xml	Wed Feb 29 13:03:59 2012 +0100
@@ -21,6 +21,7 @@
 ************************************************************************
 */
 v_projecttaskid VARCHAR2(32);
+v_Count NUMBER;
     
 BEGIN
     
@@ -41,6 +42,16 @@
     AND ISCOMPLETE='N';
   END IF;
 END IF;
+
+IF UPDATING THEN
+  SELECT COUNT(*) INTO v_Count FROM C_PROJECTTASK WHERE C_PROJECTPHASE_ID = :NEW.C_PROJECTPHASE_ID;
+  IF(v_Count > 0) THEN
+    UPDATE C_PROJECTTASK
+    SET AD_ORG_ID = :NEW.AD_ORG_ID
+    WHERE C_PROJECTPHASE_ID = :NEW.C_PROJECTPHASE_ID;
+  END IF;
+END IF;
+
 END C_PROJECTPHASE_TRG
 ]]></body>
     </trigger>
--- a/src-db/database/model/triggers/C_PROJECT_TRG.xml	Wed Feb 29 16:38:17 2012 +0100
+++ b/src-db/database/model/triggers/C_PROJECT_TRG.xml	Wed Feb 29 13:03:59 2012 +0100
@@ -31,6 +31,7 @@
     ************************************************************************/
     v_Tree_ID VARCHAR2(32);
   v_Parent_ID VARCHAR2(32);
+    v_Count NUMBER;
   --
   TYPE RECORD IS REF CURSOR;
     Cur_Defaults RECORD;
@@ -110,6 +111,13 @@
       )
       ;
     ELSIF (UPDATING) THEN
+     SELECT COUNT(*) INTO v_Count FROM C_PROJECTPHASE WHERE C_PROJECT_ID = :new.C_PROJECT_ID;
+     IF(v_Count > 0) THEN
+      UPDATE C_PROJECTPHASE
+      SET AD_ORG_ID = :new.AD_ORG_ID
+      WHERE C_PROJECT_ID = :new.C_PROJECT_ID;
+     END IF;
+     
      UPDATE C_PROJECT_ACCT SET AD_ORG_ID = :new.AD_ORG_ID
      WHERE C_PROJECT_ID = :new.C_PROJECT_ID;
     END IF;
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed Feb 29 16:38:17 2012 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Wed Feb 29 13:03:59 2012 +0100
@@ -77328,7 +77328,7 @@
 <!--6644-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--6644-->  <GRID_SEQNO><![CDATA[10]]></GRID_SEQNO>
 <!--6644-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--6644-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--6644-->  <STARTNEWLINE><![CDATA[Y]]></STARTNEWLINE>
 <!--6644-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--6644-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--6644--></AD_FIELD>
@@ -77759,9 +77759,10 @@
 <!--6660-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--6660-->  <AD_TAB_ID><![CDATA[478]]></AD_TAB_ID>
 <!--6660-->  <AD_COLUMN_ID><![CDATA[8726]]></AD_COLUMN_ID>
-<!--6660-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--6660-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--6660-->  <DISPLAYLENGTH><![CDATA[44]]></DISPLAYLENGTH>
 <!--6660-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--6660-->  <SEQNO><![CDATA[5]]></SEQNO>
 <!--6660-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
 <!--6660-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--6660-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -78307,9 +78308,10 @@
 <!--6790-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--6790-->  <AD_TAB_ID><![CDATA[490]]></AD_TAB_ID>
 <!--6790-->  <AD_COLUMN_ID><![CDATA[8887]]></AD_COLUMN_ID>
-<!--6790-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--6790-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
 <!--6790-->  <DISPLAYLENGTH><![CDATA[44]]></DISPLAYLENGTH>
 <!--6790-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--6790-->  <SEQNO><![CDATA[5]]></SEQNO>
 <!--6790-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
 <!--6790-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--6790-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
@@ -78372,7 +78374,7 @@
 <!--6792-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--6792-->  <GRID_SEQNO><![CDATA[10]]></GRID_SEQNO>
 <!--6792-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
-<!--6792-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--6792-->  <STARTNEWLINE><![CDATA[Y]]></STARTNEWLINE>
 <!--6792-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--6792-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--6792--></AD_FIELD>