[Logistics] Fixes on M_MOVEMENT_POST
authorUnai Martirena <unai.martirena@openbravo.com>
Mon, 14 Mar 2016 09:54:56 +0100
changeset 28831 1a77447abb0e
parent 28830 637037788ad7
child 28832 b6834e184017
[Logistics] Fixes on M_MOVEMENT_POST
src-db/database/model/functions/M_MOVEMENT_POST.xml
src-db/database/model/tables/M_PRODUCT.xml
src-db/database/sourcedata/AD_COLUMN.xml
--- a/src-db/database/model/functions/M_MOVEMENT_POST.xml	Mon Mar 07 12:08:38 2016 +0100
+++ b/src-db/database/model/functions/M_MOVEMENT_POST.xml	Mon Mar 14 09:54:56 2016 +0100
@@ -89,6 +89,7 @@
 	    END LOOP; -- Get Parameter
     ELSE
 	    v_Record_ID:=p_movement_id;
+      SELECT createdby INTO v_p_User FROM m_movement WHERE m_movement_id = v_Record_ID ;
 	  END IF;
     DBMS_OUTPUT.PUT_LINE('  Record_ID=' || v_Record_ID) ;
     -- Reading Movement
@@ -347,9 +348,13 @@
     v_ResultStr:='UnLockingMovement';
     UPDATE M_Movement  SET Processing='N'  WHERE M_Movement_ID=v_Record_ID;
 
+    IF(pinstance_id IS NOT NULL) THEN
     --  Update AD_PInstance
-    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
-    AD_UPDATE_PINSTANCE(PInstance_ID, v_p_User, 'N', v_Result, v_Message) ;
+      DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
+      AD_UPDATE_PINSTANCE(PInstance_ID, v_p_User, 'N', v_Result, v_Message) ;
+    ELSE
+      DBMS_OUTPUT.PUT_LINE('--<<M_MovementPost finished>>') ;
+    END IF ;
     RETURN;
   END; --BODY
 EXCEPTION
@@ -359,7 +364,9 @@
   ROLLBACK;
   UPDATE M_Movement  SET Processing='N',Updated=now(),UpdatedBy=v_p_User  WHERE M_Movement_ID=v_Record_ID;
   -- Commented by cromero 19102006 COMMIT;
-  AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
+  IF(pinstance_id IS NOT NULL) THEN
+    AD_UPDATE_PINSTANCE(PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
+  END IF ;
   RETURN;
 END M_MOVEMENT_POST
 ]]></body>
--- a/src-db/database/model/tables/M_PRODUCT.xml	Mon Mar 07 12:08:38 2016 +0100
+++ b/src-db/database/model/tables/M_PRODUCT.xml	Mon Mar 14 09:54:56 2016 +0100
@@ -377,10 +377,6 @@
         <default><![CDATA[N]]></default>
         <onCreateDefault><![CDATA['N']]></onCreateDefault>
       </column>
-      <column name="UNIQUE_PER_DOCUMENT" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
-        <default><![CDATA[N]]></default>
-        <onCreateDefault><![CDATA['N']]></onCreateDefault>
-      </column>
       <column name="RELATEPRODCATTOSERVICE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
         <default/>
         <onCreateDefault/>
@@ -405,6 +401,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="UNIQUE_PER_DOCUMENT" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault><![CDATA['N']]></onCreateDefault>
+      </column>
       <foreign-key foreignTable="AD_ORG" name="AD_ORG_MPRODUCT">
         <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Mon Mar 07 12:08:38 2016 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Mon Mar 14 09:54:56 2016 +0100
@@ -240517,6 +240517,8 @@
 <!--1040A945DD4048AD8D43449847A6EB11-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--1040A945DD4048AD8D43449847A6EB11-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--1040A945DD4048AD8D43449847A6EB11-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--1040A945DD4048AD8D43449847A6EB11--></AD_COLUMN>
 
 <!--1050C23BA102443A86AB2AF85D8F098D--><AD_COLUMN>
@@ -241299,6 +241301,8 @@
 <!--129F2530A63B4C7CA9AF17996732E6A4-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--129F2530A63B4C7CA9AF17996732E6A4-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--129F2530A63B4C7CA9AF17996732E6A4-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--129F2530A63B4C7CA9AF17996732E6A4-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--129F2530A63B4C7CA9AF17996732E6A4--></AD_COLUMN>
 
 <!--12ABCD6B91A348CBB09D4629CA6E707A--><AD_COLUMN>
@@ -241335,6 +241339,8 @@
 <!--12ABCD6B91A348CBB09D4629CA6E707A-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--12ABCD6B91A348CBB09D4629CA6E707A-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--12ABCD6B91A348CBB09D4629CA6E707A-->  <ENTITY_ALIAS><![CDATA[sol.product]]></ENTITY_ALIAS>
+<!--12ABCD6B91A348CBB09D4629CA6E707A-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--12ABCD6B91A348CBB09D4629CA6E707A-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--12ABCD6B91A348CBB09D4629CA6E707A--></AD_COLUMN>
 
 <!--12AF6F485DA5465A8A17A93DBC37E9C1--><AD_COLUMN>
@@ -241371,6 +241377,8 @@
 <!--12AF6F485DA5465A8A17A93DBC37E9C1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--12AF6F485DA5465A8A17A93DBC37E9C1-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--12AF6F485DA5465A8A17A93DBC37E9C1-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--12AF6F485DA5465A8A17A93DBC37E9C1-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--12AF6F485DA5465A8A17A93DBC37E9C1-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--12AF6F485DA5465A8A17A93DBC37E9C1--></AD_COLUMN>
 
 <!--12D57FF1727C4142B92FE30883E69C3A--><AD_COLUMN>
@@ -259026,6 +259034,8 @@
 <!--51E299D6B5824EC480B524E1ED726985-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--51E299D6B5824EC480B524E1ED726985-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--51E299D6B5824EC480B524E1ED726985-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--51E299D6B5824EC480B524E1ED726985-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--51E299D6B5824EC480B524E1ED726985-->  <EM_OBUIAPP_PROCESS_ID><![CDATA[0C2AFAEFB67B4CB8A1429195EB119A49]]></EM_OBUIAPP_PROCESS_ID>
 <!--51E299D6B5824EC480B524E1ED726985--></AD_COLUMN>
 
@@ -268833,6 +268843,8 @@
 <!--57E9885AC7E14F158A4CF1F818874AA1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--57E9885AC7E14F158A4CF1F818874AA1-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--57E9885AC7E14F158A4CF1F818874AA1--></AD_COLUMN>
 
 <!--5807449695A38D81E040007F010127AB--><AD_COLUMN>
@@ -322067,6 +322079,8 @@
 <!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--9AEBE3623CCD4E6F820A2EB70F2F243D-->  <EM_OBUIAPP_PROCESS_ID><![CDATA[A2FAF49712D1445ABE750315CE1B473A]]></EM_OBUIAPP_PROCESS_ID>
 <!--9AEBE3623CCD4E6F820A2EB70F2F243D--></AD_COLUMN>
 
@@ -343001,6 +343015,8 @@
 <!--C724ECE5B05848489719C64111425FDB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--C724ECE5B05848489719C64111425FDB-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--C724ECE5B05848489719C64111425FDB-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--C724ECE5B05848489719C64111425FDB-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--C724ECE5B05848489719C64111425FDB-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--C724ECE5B05848489719C64111425FDB--></AD_COLUMN>
 
 <!--C73593CD83514760916EBC58EEB5EB41--><AD_COLUMN>
@@ -345887,6 +345903,8 @@
 <!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--CB3A64CFC2B8471E91DBBF12A663D0FB-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--CB3A64CFC2B8471E91DBBF12A663D0FB--></AD_COLUMN>
 
 <!--CB3B154781F840CCA73D6656027F5595--><AD_COLUMN>
@@ -363563,6 +363581,8 @@
 <!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--F54BEAEAA4C04BDD9DC1448954589ED0-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
 <!--F54BEAEAA4C04BDD9DC1448954589ED0--></AD_COLUMN>
 
 <!--F55387BA03C14531AA6A20E0AF799E1B--><AD_COLUMN>