Merged back support for module merge
authorAsier Lostalé <asier.lostale@openbravo.com>
Thu, 11 Nov 2010 18:11:49 +0100
changeset 8885 f09309154fe3
parent 8854 5062cc74d716 (current diff)
parent 8884 7844c1d1a058 (diff)
child 8886 b6faf0f560df
Merged back support for module merge
build.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MESSAGE.xml
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_TEXTINTERFACES.xml
src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java
src/org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP1.html
--- a/build.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/build.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -1079,4 +1079,11 @@
       </classpath>
     </java>
   </target>
+  
+  <target name="check.module.consistency">
+    <taskdef name="checkConsistency" classname="org.openbravo.erpCommon.modules.CheckLocalConsistency">
+      <classpath refid="project.class.path" />
+    </taskdef>
+    <checkConsistency userId="0" adminMode="true" propertiesFile="${base.config}/Openbravo.properties"/>
+  </target>
 </project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/tables/AD_MODULE_MERGE.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+  <database name="TABLE AD_MODULE_MERGE">
+    <table name="AD_MODULE_MERGE" primaryKey="AD_MODULE_MERGE_PK">
+      <column name="AD_MODULE_MERGE_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[Y]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default><![CDATA[SYSDATE]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default><![CDATA[SYSDATE]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="AD_MODULE_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="MERGED_MODULE_UUID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="MERGED_MODULE_NAME" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="AD_CLIENT" name="AD_MODULE_MERGE_AD_CLIENT">
+        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_MODULE" name="AD_MODULE_MERGE_AD_MODULE" onDelete="cascade">
+        <reference local="AD_MODULE_ID" foreign="AD_MODULE_ID"/>
+      </foreign-key>
+      <foreign-key foreignTable="AD_ORG" name="AD_MODULE_MERGEAD_ORG">
+        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
+      </foreign-key>
+      <unique name="AD_MODULE_MERGE_UN">
+        <unique-column name="AD_MODULE_ID"/>
+        <unique-column name="MERGED_MODULE_UUID"/>
+      </unique>
+      <check name="AD_MODULE_MERGE_ISACTIVE_CK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
+    </table>
+  </database>
--- a/src-db/database/model/triggers/AD_MODULE_DBPREFIX_TRG.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/model/triggers/AD_MODULE_DBPREFIX_TRG.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -43,9 +43,9 @@
      v_old_name := :OLD.NAME;
    END IF;
    
-   IF  (INSERTING AND v_IsRegistered='Y') 
-    OR (UPDATING AND v_IsRegistered='Y' AND :NEW.NAME != v_old_name) THEN
-    RAISE_APPLICATION_ERROR(-20534, 'Cannot modify registered module.');
+   IF  UPDATING AND v_IsRegistered='Y' AND :NEW.NAME != v_old_name THEN
+    -- Cannot modify registered module
+    RAISE_APPLICATION_ERROR(-20000, '@20534@');
    END IF;
    --Check DB_Prefix
    IF INSERTING OR UPDATING THEN
--- a/src-db/database/model/triggers/AD_MODULE_DBPREFIX_UNIQUE_TRG.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/model/triggers/AD_MODULE_DBPREFIX_UNIQUE_TRG.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -31,8 +31,11 @@
   select count(*) 
     into numWrongModules 
     from (select 1 
-            from ad_module_dbprefix 
+            from ad_module_dbprefix d
            where ad_module_id<>'0' 
+             and not exists (select 1 
+                               from ad_module_merge m
+                              where m.ad_module_id = d.ad_module_id)
            group by ad_module_id having count(*)>1) f;
 
 
--- a/src-db/database/model/triggers/AD_MODULE_DENPENDENCY_TRG.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/model/triggers/AD_MODULE_DENPENDENCY_TRG.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -14,12 +14,13 @@
   * under the License.
   * The Original Code is Openbravo ERP.
   * The Initial Developer of the Original Code is Openbravo SLU
-  * All portions are Copyright (C) 2008 Openbravo SLU
+  * All portions are Copyright (C) 2008-2010 Openbravo SLU
   * All Rights Reserved.
   * Contributor(s):  ______________________________________.
   ************************************************************************/
   v_Type VARCHAR2(60);
   v_name VARCHAR2(60);
+  v_Aux  NUMBER;
     
 BEGIN
     
@@ -40,6 +41,16 @@
   IF v_Type = 'M' AND :new.IsIncluded = 'Y' THEN
     RAISE_APPLICATION_ERROR(-20530, 'Simple modules cannot contain other modules') ;
   END IF;
+  
+  SELECT COUNT(*)
+    INTO v_Aux
+    FROM AD_MODULE_MERGE
+   WHERE Merged_Module_UUID = :new.AD_Dependent_Module_ID;
+   
+  IF v_aux>0 THEN
+    RAISE_APPLICATION_ERROR(-20000, '@CannotMergeDependency@');
+  END IF;
+  
   :new.Dependant_Module_Name := v_name;
 END AD_MODULE_DENPENDENCY_TRG
 ]]></body>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/AD_MODULE_MERGE_MOD_TRG.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER AD_MODULE_MERGE_MOD_TRG">
+    <trigger name="AD_MODULE_MERGE_MOD_TRG" table="AD_MODULE_MERGE" fires="before" insert="true" update="true" delete="true" foreach="row">
+      <body><![CDATA[
+
+/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SLU
+* All portions are Copyright (C) 2010 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+  devTemplate NUMBER;
+  devModule   CHAR(1);
+  cuerrentModuleID  VARCHAR2(32);
+  vAux NUMBER;
+    
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+  --Check if trying to move object from module not in dev
+  IF (UPDATING) THEN
+    IF (COALESCE(:NEW.AD_Module_ID , '.') != COALESCE(:OLD.AD_Module_ID , '.')) THEN
+      SELECT COUNT(*) 
+        INTO vAux
+        FROM AD_MODULE
+       WHERE AD_MODULE_ID = :old.AD_Module_ID
+        AND isindevelopment = 'N';
+      IF (vAux!=0) THEN
+        RAISE_APPLICATION_ERROR(-20000, '@ChangeNotInDevModule@');
+      END IF;
+    END IF;
+  END IF;
+
+  SELECT COUNT(*)
+    INTO devTemplate
+    FROM AD_MODULE
+   WHERE IsInDevelopment = 'Y'
+     AND Type = 'T';
+     
+  IF (UPDATING OR INSERTING) THEN
+    cuerrentModuleID := :new.AD_Module_ID;
+  ELSE
+    cuerrentModuleID := :old.AD_Module_ID;
+  END IF;
+  
+  SELECT M.IsInDevelopment
+    INTO devModule
+    FROM AD_MODULE M
+   WHERE M.AD_MODULE_ID = cuerrentModuleID;
+     
+  IF (UPDATING AND devTemplate=0 AND devModule='N') THEN
+    IF (
+        :NEW.AD_Client_ID       != :OLD.AD_Client_ID       OR
+        :NEW.AD_Org_ID          != :OLD.AD_Org_ID          OR
+        :NEW.Isactive           != :OLD.Isactive           OR
+        :NEW.AD_Module_ID       != :OLD.AD_Module_ID       OR
+        :NEW.Merged_Module_UUID != :OLD.Merged_Module_UUID OR
+        :NEW.Merged_Module_Name != :OLD.Merged_Module_Name
+       ) THEN
+      --Cannot update an object in a module not in developement and without an active template
+      RAISE_APPLICATION_ERROR(-20000, '@20532@');
+    END IF;
+  END IF;
+  
+  IF ((DELETING OR INSERTING) AND devModule='N') THEN
+    --Cannot insert/delete objects in a module not in development.
+    RAISE_APPLICATION_ERROR(-20000, '@20533@');
+  END IF;
+END AD_MODULE_MERGE_MOD_TRG
+]]></body>
+    </trigger>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/AD_MODULE_MERGE_TRG.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER AD_MODULE_MERGE_TRG">
+    <trigger name="AD_MODULE_MERGE_TRG" table="AD_MODULE_MERGE" fires="before" insert="true" update="true" delete="false" foreach="row">
+      <body><![CDATA[
+  /*************************************************************************
+  * The contents of this file are subject to the Openbravo  Public  License
+  * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+  * Version 1.1  with a permitted attribution clause; you may not  use this
+  * file except in compliance with the License. You  may  obtain  a copy of
+  * the License at http://www.openbravo.com/legal/license.html
+  * Software distributed under the License  is  distributed  on  an "AS IS"
+  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+  * License for the specific  language  governing  rights  and  limitations
+  * under the License.
+  * The Original Code is Openbravo ERP.
+  * The Initial Developer of the Original Code is Openbravo SLU
+  * All portions are Copyright (C) 2010 Openbravo SLU
+  * All Rights Reserved.
+  * Contributor(s):  ______________________________________.
+  ************************************************************************/
+
+  v_Aux  NUMBER;
+   
+BEGIN
+  
+  SELECT COUNT(*)
+    INTO v_Aux
+    FROM AD_MODULE_DEPENDENCY
+   WHERE AD_Dependent_Module_ID = :new.Merged_Module_UUID;
+   
+  IF v_aux>0 THEN
+    RAISE_APPLICATION_ERROR(-20000, '@CannotMergeDependency@');
+  END IF;
+
+END AD_MODULE_MERGE_TRG
+]]></body>
+    </trigger>
+  </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -308942,6 +308942,376 @@
 <!--92FC7A19DAD0930CE040007F010048EB-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--92FC7A19DAD0930CE040007F010048EB--></AD_COLUMN>
 
+<!--9382FCA58F4EAF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F4EAF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <NAME><![CDATA[AD_Module_Merge_ID]]></NAME>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[AD_Module_Merge_ID]]></COLUMNNAME>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[13]]></AD_REFERENCE_ID>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISKEY><![CDATA[Y]]></ISKEY>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[9382FCA58F60AF36E040A8C021013A93]]></AD_ELEMENT_ID>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <POSITION><![CDATA[1]]></POSITION>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F4EAF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F4EAF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F4FAF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F4FAF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <NAME><![CDATA[Client]]></NAME>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[AD_Client_ID]]></COLUMNNAME>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <AD_VAL_RULE_ID><![CDATA[103]]></AD_VAL_RULE_ID>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <DEFAULTVALUE><![CDATA[@AD_CLIENT_ID@]]></DEFAULTVALUE>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[102]]></AD_ELEMENT_ID>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <POSITION><![CDATA[2]]></POSITION>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F4FAF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F4FAF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F50AF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F50AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <NAME><![CDATA[Organization]]></NAME>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[AD_Org_ID]]></COLUMNNAME>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <AD_VAL_RULE_ID><![CDATA[104]]></AD_VAL_RULE_ID>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <DEFAULTVALUE><![CDATA[@AD_ORG_ID@]]></DEFAULTVALUE>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[113]]></AD_ELEMENT_ID>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <POSITION><![CDATA[3]]></POSITION>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F50AF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F50AF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F51AF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F51AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <NAME><![CDATA[Active]]></NAME>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[A flag indicating whether this record is available for use or de-activated.]]></DESCRIPTION>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <HELP><![CDATA[There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reporting. There are two reasons for de-activating and not deleting records: 
+(1) The system requires the record for auditing purposes.
+(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are existing invoices for it. By de-activating the Business Partner you prevent it from being used in future transactions.]]></HELP>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[Isactive]]></COLUMNNAME>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <DEFAULTVALUE><![CDATA[Y]]></DEFAULTVALUE>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[348]]></AD_ELEMENT_ID>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <POSITION><![CDATA[4]]></POSITION>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F51AF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F51AF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F52AF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F52AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <NAME><![CDATA[Creation Date]]></NAME>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[The date that this record is completed.]]></DESCRIPTION>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <HELP><![CDATA[The Created field indicates the date that this record was created.]]></HELP>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[Created]]></COLUMNNAME>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[16]]></AD_REFERENCE_ID>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <DEFAULTVALUE><![CDATA[SYSDATE]]></DEFAULTVALUE>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[245]]></AD_ELEMENT_ID>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <POSITION><![CDATA[5]]></POSITION>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F52AF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F52AF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F53AF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F53AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <NAME><![CDATA[Created By]]></NAME>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[User who created this records]]></DESCRIPTION>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <HELP><![CDATA[The Created By field indicates the user who created this record.]]></HELP>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[Createdby]]></COLUMNNAME>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[246]]></AD_ELEMENT_ID>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <POSITION><![CDATA[6]]></POSITION>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F53AF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F53AF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F54AF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F54AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <NAME><![CDATA[Updated]]></NAME>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[x not implemented]]></DESCRIPTION>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <HELP><![CDATA[The Updated field indicates the date that this record was updated.]]></HELP>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[Updated]]></COLUMNNAME>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[16]]></AD_REFERENCE_ID>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <DEFAULTVALUE><![CDATA[SYSDATE]]></DEFAULTVALUE>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[607]]></AD_ELEMENT_ID>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <POSITION><![CDATA[7]]></POSITION>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F54AF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F54AF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F55AF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F55AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <NAME><![CDATA[Updated By]]></NAME>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[User who updated this records]]></DESCRIPTION>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <HELP><![CDATA[The Updated By field indicates the user who updated this record.]]></HELP>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[Updatedby]]></COLUMNNAME>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[608]]></AD_ELEMENT_ID>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <POSITION><![CDATA[8]]></POSITION>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F55AF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F55AF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F56AF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F56AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <NAME><![CDATA[Module]]></NAME>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[Module]]></DESCRIPTION>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <HELP><![CDATA[Indicates the module the element forms part of.]]></HELP>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[AD_Module_ID]]></COLUMNNAME>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISPARENT><![CDATA[Y]]></ISPARENT>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[N]]></ISUPDATEABLE>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[Y]]></ISIDENTIFIER>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <SEQNO><![CDATA[90]]></SEQNO>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[565E666A619A2693E040007F01002851]]></AD_ELEMENT_ID>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <POSITION><![CDATA[9]]></POSITION>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F56AF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F56AF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F57AF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F57AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <NAME><![CDATA[Merged Module UUID]]></NAME>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[UUID of the merged module.]]></DESCRIPTION>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <HELP><![CDATA[It is the UUID of the merged module, it is very important to correctly setup this information since it will be internally used to identify the merged module.]]></HELP>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[Merged_Module_Uuid]]></COLUMNNAME>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[9382FCA58F5FAF36E040A8C021013A93]]></AD_ELEMENT_ID>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <POSITION><![CDATA[10]]></POSITION>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F57AF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F57AF36E040A8C021013A93--></AD_COLUMN>
+
+<!--9382FCA58F58AF36E040A8C021013A93--><AD_COLUMN>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <AD_COLUMN_ID><![CDATA[9382FCA58F58AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <NAME><![CDATA[Merged Module Name]]></NAME>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[Name of the merged module]]></DESCRIPTION>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <HELP><![CDATA[Name of the merged module. It is used just to make the merged module human readable.]]></HELP>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[Merged_Module_Name]]></COLUMNNAME>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISIDENTIFIER><![CDATA[Y]]></ISIDENTIFIER>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <SEQNO><![CDATA[110]]></SEQNO>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[9382FCA58F61AF36E040A8C021013A93]]></AD_ELEMENT_ID>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <POSITION><![CDATA[11]]></POSITION>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--9382FCA58F58AF36E040A8C021013A93-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--9382FCA58F58AF36E040A8C021013A93--></AD_COLUMN>
+
 <!--9397E02890414B43E040007F0100749D--><AD_COLUMN>
 <!--9397E02890414B43E040007F0100749D-->  <AD_COLUMN_ID><![CDATA[9397E02890414B43E040007F0100749D]]></AD_COLUMN_ID>
 <!--9397E02890414B43E040007F0100749D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_DATASET_TABLE.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_DATASET_TABLE.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -126,6 +126,20 @@
 <!--1BA50CC296DC11DD8DA5001B388C61A4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--1BA50CC296DC11DD8DA5001B388C61A4--></AD_DATASET_TABLE>
 
+<!--1F478DEE06474355B2390C0BCBE65E7D--><AD_DATASET_TABLE>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <AD_DATASET_TABLE_ID><![CDATA[1F478DEE06474355B2390C0BCBE65E7D]]></AD_DATASET_TABLE_ID>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <AD_DATASET_ID><![CDATA[0]]></AD_DATASET_ID>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <INCLUDEALLCOLUMNS><![CDATA[Y]]></INCLUDEALLCOLUMNS>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <WHERECLAUSE><![CDATA[ad_module_id in (:moduleid)]]></WHERECLAUSE>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <EXCLUDEAUDITINFO><![CDATA[Y]]></EXCLUDEAUDITINFO>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <ISBUSINESSOBJECT><![CDATA[N]]></ISBUSINESSOBJECT>
+<!--1F478DEE06474355B2390C0BCBE65E7D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1F478DEE06474355B2390C0BCBE65E7D--></AD_DATASET_TABLE>
+
 <!--1F64026096E011DDADF9001B388C61A4--><AD_DATASET_TABLE>
 <!--1F64026096E011DDADF9001B388C61A4-->  <AD_DATASET_TABLE_ID><![CDATA[1F64026096E011DDADF9001B388C61A4]]></AD_DATASET_TABLE_ID>
 <!--1F64026096E011DDADF9001B388C61A4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -27299,6 +27299,43 @@
 <!--92960702F3C3E1DAE040007F010046D0-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--92960702F3C3E1DAE040007F010046D0--></AD_ELEMENT>
 
+<!--9382FCA58F5FAF36E040A8C021013A93--><AD_ELEMENT>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[9382FCA58F5FAF36E040A8C021013A93]]></AD_ELEMENT_ID>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[Merged_Module_Uuid]]></COLUMNNAME>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <NAME><![CDATA[Merged Module UUID]]></NAME>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <PRINTNAME><![CDATA[Merged Module UUID]]></PRINTNAME>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[UUID of the merged module.]]></DESCRIPTION>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <HELP><![CDATA[It is the UUID of the merged module, it is very important to correctly setup this information since it will be internally used to identify the merged module.]]></HELP>
+<!--9382FCA58F5FAF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F5FAF36E040A8C021013A93--></AD_ELEMENT>
+
+<!--9382FCA58F60AF36E040A8C021013A93--><AD_ELEMENT>
+<!--9382FCA58F60AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[9382FCA58F60AF36E040A8C021013A93]]></AD_ELEMENT_ID>
+<!--9382FCA58F60AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F60AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F60AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F60AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[AD_Module_Merge_ID]]></COLUMNNAME>
+<!--9382FCA58F60AF36E040A8C021013A93-->  <NAME><![CDATA[AD_Module_Merge_ID]]></NAME>
+<!--9382FCA58F60AF36E040A8C021013A93-->  <PRINTNAME><![CDATA[AD_Module_Merge_ID]]></PRINTNAME>
+<!--9382FCA58F60AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F60AF36E040A8C021013A93--></AD_ELEMENT>
+
+<!--9382FCA58F61AF36E040A8C021013A93--><AD_ELEMENT>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <AD_ELEMENT_ID><![CDATA[9382FCA58F61AF36E040A8C021013A93]]></AD_ELEMENT_ID>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <COLUMNNAME><![CDATA[Merged_Module_Name]]></COLUMNNAME>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <NAME><![CDATA[Merged Module Name]]></NAME>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <PRINTNAME><![CDATA[Merged Module Name]]></PRINTNAME>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <DESCRIPTION><![CDATA[Name of the merged module]]></DESCRIPTION>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <HELP><![CDATA[Name of the merged module. It is used just to make the merged module human readable.]]></HELP>
+<!--9382FCA58F61AF36E040A8C021013A93-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9382FCA58F61AF36E040A8C021013A93--></AD_ELEMENT>
+
 <!--9397E02890444B43E040007F0100749D--><AD_ELEMENT>
 <!--9397E02890444B43E040007F0100749D-->  <AD_ELEMENT_ID><![CDATA[9397E02890444B43E040007F0100749D]]></AD_ELEMENT_ID>
 <!--9397E02890444B43E040007F0100749D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -203293,6 +203293,166 @@
 <!--93092ACE16BA46B8B0C7AA66DCAF80BE-->  <GRID_SEQNO><![CDATA[20]]></GRID_SEQNO>
 <!--93092ACE16BA46B8B0C7AA66DCAF80BE--></AD_FIELD>
 
+<!--93841E6B1A68FD08E040A8C021013AB6--><AD_FIELD>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <AD_FIELD_ID><![CDATA[93841E6B1A68FD08E040A8C021013AB6]]></AD_FIELD_ID>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <NAME><![CDATA[Client]]></NAME>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <AD_COLUMN_ID><![CDATA[9382FCA58F4FAF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--93841E6B1A68FD08E040A8C021013AB6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--93841E6B1A68FD08E040A8C021013AB6--></AD_FIELD>
+
+<!--93841E6B1A69FD08E040A8C021013AB6--><AD_FIELD>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <AD_FIELD_ID><![CDATA[93841E6B1A69FD08E040A8C021013AB6]]></AD_FIELD_ID>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <NAME><![CDATA[Module]]></NAME>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <DESCRIPTION><![CDATA[Module]]></DESCRIPTION>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <HELP><![CDATA[Indicates the module the element forms part of.]]></HELP>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <AD_COLUMN_ID><![CDATA[9382FCA58F56AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--93841E6B1A69FD08E040A8C021013AB6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--93841E6B1A69FD08E040A8C021013AB6--></AD_FIELD>
+
+<!--93841E6B1A6AFD08E040A8C021013AB6--><AD_FIELD>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <AD_FIELD_ID><![CDATA[93841E6B1A6AFD08E040A8C021013AB6]]></AD_FIELD_ID>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <NAME><![CDATA[AD_Module_Merge_ID]]></NAME>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <AD_COLUMN_ID><![CDATA[9382FCA58F4EAF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--93841E6B1A6AFD08E040A8C021013AB6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--93841E6B1A6AFD08E040A8C021013AB6--></AD_FIELD>
+
+<!--93841E6B1A6BFD08E040A8C021013AB6--><AD_FIELD>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <AD_FIELD_ID><![CDATA[93841E6B1A6BFD08E040A8C021013AB6]]></AD_FIELD_ID>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <NAME><![CDATA[Organization]]></NAME>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <AD_COLUMN_ID><![CDATA[9382FCA58F50AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--93841E6B1A6BFD08E040A8C021013AB6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--93841E6B1A6BFD08E040A8C021013AB6--></AD_FIELD>
+
+<!--93841E6B1A6CFD08E040A8C021013AB6--><AD_FIELD>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <AD_FIELD_ID><![CDATA[93841E6B1A6CFD08E040A8C021013AB6]]></AD_FIELD_ID>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <NAME><![CDATA[Active]]></NAME>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <DESCRIPTION><![CDATA[A flag indicating whether this record is available for use or de-activated.]]></DESCRIPTION>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <HELP><![CDATA[There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reporting. There are two reasons for de-activating and not deleting records: 
+(1) The system requires the record for auditing purposes.
+(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are existing invoices for it. By de-activating the Business Partner you prevent it from being used in future transactions.]]></HELP>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <AD_COLUMN_ID><![CDATA[9382FCA58F51AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--93841E6B1A6CFD08E040A8C021013AB6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--93841E6B1A6CFD08E040A8C021013AB6--></AD_FIELD>
+
+<!--93841E6B1A6DFD08E040A8C021013AB6--><AD_FIELD>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <AD_FIELD_ID><![CDATA[93841E6B1A6DFD08E040A8C021013AB6]]></AD_FIELD_ID>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <NAME><![CDATA[Merged Module Name]]></NAME>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <DESCRIPTION><![CDATA[Name of the merged module]]></DESCRIPTION>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <HELP><![CDATA[Name of the merged module. It is used just to make the merged module human readable.]]></HELP>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <AD_COLUMN_ID><![CDATA[9382FCA58F58AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--93841E6B1A6DFD08E040A8C021013AB6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--93841E6B1A6DFD08E040A8C021013AB6--></AD_FIELD>
+
+<!--93841E6B1A6EFD08E040A8C021013AB6--><AD_FIELD>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <AD_FIELD_ID><![CDATA[93841E6B1A6EFD08E040A8C021013AB6]]></AD_FIELD_ID>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <NAME><![CDATA[Merged Module UUID]]></NAME>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <DESCRIPTION><![CDATA[UUID of the merged module.]]></DESCRIPTION>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <HELP><![CDATA[It is the UUID of the merged module, it is very important to correctly setup this information since it will be internally used to identify the merged module.]]></HELP>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <AD_COLUMN_ID><![CDATA[9382FCA58F57AF36E040A8C021013A93]]></AD_COLUMN_ID>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--93841E6B1A6EFD08E040A8C021013AB6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--93841E6B1A6EFD08E040A8C021013AB6--></AD_FIELD>
+
 <!--9397E028904B4B43E040007F0100749D--><AD_FIELD>
 <!--9397E028904B4B43E040007F0100749D-->  <AD_FIELD_ID><![CDATA[9397E028904B4B43E040007F0100749D]]></AD_FIELD_ID>
 <!--9397E028904B4B43E040007F0100749D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -29630,6 +29630,17 @@
 <!--064ADCDC0E794F6C9608ECFDC511A1F9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--064ADCDC0E794F6C9608ECFDC511A1F9--></AD_MESSAGE>
 
+<!--07E963D65B7F47BE81150448C5019E0D--><AD_MESSAGE>
+<!--07E963D65B7F47BE81150448C5019E0D-->  <AD_MESSAGE_ID><![CDATA[07E963D65B7F47BE81150448C5019E0D]]></AD_MESSAGE_ID>
+<!--07E963D65B7F47BE81150448C5019E0D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--07E963D65B7F47BE81150448C5019E0D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--07E963D65B7F47BE81150448C5019E0D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--07E963D65B7F47BE81150448C5019E0D-->  <VALUE><![CDATA[CannotInstallMerged]]></VALUE>
+<!--07E963D65B7F47BE81150448C5019E0D-->  <MSGTEXT><![CDATA[cannot be installed because it is included as merge within an already installed module.]]></MSGTEXT>
+<!--07E963D65B7F47BE81150448C5019E0D-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--07E963D65B7F47BE81150448C5019E0D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--07E963D65B7F47BE81150448C5019E0D--></AD_MESSAGE>
+
 <!--0C093B834C3948E1B8D84E54FC6B284E--><AD_MESSAGE>
 <!--0C093B834C3948E1B8D84E54FC6B284E-->  <AD_MESSAGE_ID><![CDATA[0C093B834C3948E1B8D84E54FC6B284E]]></AD_MESSAGE_ID>
 <!--0C093B834C3948E1B8D84E54FC6B284E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -30220,7 +30231,7 @@
 <!--234443E5BAB34ABC892AFDE05F9C229D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--234443E5BAB34ABC892AFDE05F9C229D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--234443E5BAB34ABC892AFDE05F9C229D-->  <VALUE><![CDATA[NotUniqueDBPrefix]]></VALUE>
-<!--234443E5BAB34ABC892AFDE05F9C229D-->  <MSGTEXT><![CDATA[Modules cannot have more than one dbprefix]]></MSGTEXT>
+<!--234443E5BAB34ABC892AFDE05F9C229D-->  <MSGTEXT><![CDATA[Modules which do not define a merge, cannot have more than one DBPrefix.]]></MSGTEXT>
 <!--234443E5BAB34ABC892AFDE05F9C229D-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
 <!--234443E5BAB34ABC892AFDE05F9C229D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--234443E5BAB34ABC892AFDE05F9C229D--></AD_MESSAGE>
@@ -31042,6 +31053,17 @@
 <!--54034A3A704740A5A1A22245348DF06B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--54034A3A704740A5A1A22245348DF06B--></AD_MESSAGE>
 
+<!--54347EFBC0594B10B1CDC1D346778A4C--><AD_MESSAGE>
+<!--54347EFBC0594B10B1CDC1D346778A4C-->  <AD_MESSAGE_ID><![CDATA[54347EFBC0594B10B1CDC1D346778A4C]]></AD_MESSAGE_ID>
+<!--54347EFBC0594B10B1CDC1D346778A4C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--54347EFBC0594B10B1CDC1D346778A4C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--54347EFBC0594B10B1CDC1D346778A4C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--54347EFBC0594B10B1CDC1D346778A4C-->  <VALUE><![CDATA[MergeUninstalled]]></VALUE>
+<!--54347EFBC0594B10B1CDC1D346778A4C-->  <MSGTEXT><![CDATA[Uninstalled merged module]]></MSGTEXT>
+<!--54347EFBC0594B10B1CDC1D346778A4C-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--54347EFBC0594B10B1CDC1D346778A4C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--54347EFBC0594B10B1CDC1D346778A4C--></AD_MESSAGE>
+
 <!--548069F5D9E04ECF80B3EA2EA7218036--><AD_MESSAGE>
 <!--548069F5D9E04ECF80B3EA2EA7218036-->  <AD_MESSAGE_ID><![CDATA[548069F5D9E04ECF80B3EA2EA7218036]]></AD_MESSAGE_ID>
 <!--548069F5D9E04ECF80B3EA2EA7218036-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -31376,6 +31398,17 @@
 <!--6392EEEB7C6F433BB2465DECD8BAAF35-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--6392EEEB7C6F433BB2465DECD8BAAF35--></AD_MESSAGE>
 
+<!--67178C115E364ED2B68EC84473CD7404--><AD_MESSAGE>
+<!--67178C115E364ED2B68EC84473CD7404-->  <AD_MESSAGE_ID><![CDATA[67178C115E364ED2B68EC84473CD7404]]></AD_MESSAGE_ID>
+<!--67178C115E364ED2B68EC84473CD7404-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--67178C115E364ED2B68EC84473CD7404-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--67178C115E364ED2B68EC84473CD7404-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--67178C115E364ED2B68EC84473CD7404-->  <VALUE><![CDATA[CR_IsMergedBy]]></VALUE>
+<!--67178C115E364ED2B68EC84473CD7404-->  <MSGTEXT><![CDATA[has been discontinued and merged into Module]]></MSGTEXT>
+<!--67178C115E364ED2B68EC84473CD7404-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--67178C115E364ED2B68EC84473CD7404-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--67178C115E364ED2B68EC84473CD7404--></AD_MESSAGE>
+
 <!--6775556A78264AB192CAD83F25E37E7B--><AD_MESSAGE>
 <!--6775556A78264AB192CAD83F25E37E7B-->  <AD_MESSAGE_ID><![CDATA[6775556A78264AB192CAD83F25E37E7B]]></AD_MESSAGE_ID>
 <!--6775556A78264AB192CAD83F25E37E7B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -31786,6 +31819,17 @@
 <!--7BF4B33E022E407BB6615E106AC7A8A6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--7BF4B33E022E407BB6615E106AC7A8A6--></AD_MESSAGE>
 
+<!--7DB1074FDA3549A1A211A0A0E16B79A7--><AD_MESSAGE>
+<!--7DB1074FDA3549A1A211A0A0E16B79A7-->  <AD_MESSAGE_ID><![CDATA[7DB1074FDA3549A1A211A0A0E16B79A7]]></AD_MESSAGE_ID>
+<!--7DB1074FDA3549A1A211A0A0E16B79A7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7DB1074FDA3549A1A211A0A0E16B79A7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7DB1074FDA3549A1A211A0A0E16B79A7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7DB1074FDA3549A1A211A0A0E16B79A7-->  <VALUE><![CDATA[CannotMergeDependency]]></VALUE>
+<!--7DB1074FDA3549A1A211A0A0E16B79A7-->  <MSGTEXT><![CDATA[This module is defined as dependency and as merge. Only one of them is allowed.]]></MSGTEXT>
+<!--7DB1074FDA3549A1A211A0A0E16B79A7-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--7DB1074FDA3549A1A211A0A0E16B79A7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7DB1074FDA3549A1A211A0A0E16B79A7--></AD_MESSAGE>
+
 <!--7DB7D480F58F4D3BB81F13B6BDE62AE5--><AD_MESSAGE>
 <!--7DB7D480F58F4D3BB81F13B6BDE62AE5-->  <AD_MESSAGE_ID><![CDATA[7DB7D480F58F4D3BB81F13B6BDE62AE5]]></AD_MESSAGE_ID>
 <!--7DB7D480F58F4D3BB81F13B6BDE62AE5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -32275,6 +32319,17 @@
 <!--9DEDEDDC6E44428A8DC45444FCB9A1DD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--9DEDEDDC6E44428A8DC45444FCB9A1DD--></AD_MESSAGE>
 
+<!--9E7F116DBB424386BB82CCD76514D4EE--><AD_MESSAGE>
+<!--9E7F116DBB424386BB82CCD76514D4EE-->  <AD_MESSAGE_ID><![CDATA[9E7F116DBB424386BB82CCD76514D4EE]]></AD_MESSAGE_ID>
+<!--9E7F116DBB424386BB82CCD76514D4EE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9E7F116DBB424386BB82CCD76514D4EE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9E7F116DBB424386BB82CCD76514D4EE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9E7F116DBB424386BB82CCD76514D4EE-->  <VALUE><![CDATA[InstallMergeToGetLatest]]></VALUE>
+<!--9E7F116DBB424386BB82CCD76514D4EE-->  <MSGTEXT><![CDATA[It is strongly recommended to install this version in order to get the latest version of the functionality and keep getting maintenance packs of module]]></MSGTEXT>
+<!--9E7F116DBB424386BB82CCD76514D4EE-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--9E7F116DBB424386BB82CCD76514D4EE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9E7F116DBB424386BB82CCD76514D4EE--></AD_MESSAGE>
+
 <!--9FAC0F65BD6F46E2B537C2E9C2340367--><AD_MESSAGE>
 <!--9FAC0F65BD6F46E2B537C2E9C2340367-->  <AD_MESSAGE_ID><![CDATA[9FAC0F65BD6F46E2B537C2E9C2340367]]></AD_MESSAGE_ID>
 <!--9FAC0F65BD6F46E2B537C2E9C2340367-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -33539,6 +33594,17 @@
 <!--E5B1FC3A84BA4ABD80C3F2F9635B65CB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--E5B1FC3A84BA4ABD80C3F2F9635B65CB--></AD_MESSAGE>
 
+<!--E667A3DF0E1D4FA6BFEE696F302C1663--><AD_MESSAGE>
+<!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <AD_MESSAGE_ID><![CDATA[E667A3DF0E1D4FA6BFEE696F302C1663]]></AD_MESSAGE_ID>
+<!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <VALUE><![CDATA[CR_MergeCannotUninstall]]></VALUE>
+<!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <MSGTEXT><![CDATA[which cannot be uninstalled because it is part of the dependencies of]]></MSGTEXT>
+<!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--E667A3DF0E1D4FA6BFEE696F302C1663-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E667A3DF0E1D4FA6BFEE696F302C1663--></AD_MESSAGE>
+
 <!--E7695A84B58B41B5915DF1B73D3E0A66--><AD_MESSAGE>
 <!--E7695A84B58B41B5915DF1B73D3E0A66-->  <AD_MESSAGE_ID><![CDATA[E7695A84B58B41B5915DF1B73D3E0A66]]></AD_MESSAGE_ID>
 <!--E7695A84B58B41B5915DF1B73D3E0A66-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -17803,6 +17803,30 @@
 <!--9178E3E031F7731CE040007F01004675-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--9178E3E031F7731CE040007F01004675--></AD_MODEL_OBJECT>
 
+<!--9382FCA58F59AF36E040A8C021013A93--><AD_MODEL_OBJECT>
+<!--9382FCA58F59AF36E040A8C021013A93-->  <AD_MODEL_OBJECT_ID><![CDATA[9382FCA58F59AF36E040A8C021013A93]]></AD_MODEL_OBJECT_ID>
+<!--9382FCA58F59AF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F59AF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F59AF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F59AF36E040A8C021013A93-->  <ACTION><![CDATA[W]]></ACTION>
+<!--9382FCA58F59AF36E040A8C021013A93-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--9382FCA58F59AF36E040A8C021013A93-->  <CLASSNAME><![CDATA[org.openbravo.erpWindows.Module.Merges]]></CLASSNAME>
+<!--9382FCA58F59AF36E040A8C021013A93-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--9382FCA58F59AF36E040A8C021013A93-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--9382FCA58F59AF36E040A8C021013A93--></AD_MODEL_OBJECT>
+
+<!--9382FCA58F5DAF36E040A8C021013A93--><AD_MODEL_OBJECT>
+<!--9382FCA58F5DAF36E040A8C021013A93-->  <AD_MODEL_OBJECT_ID><![CDATA[9382FCA58F5DAF36E040A8C021013A93]]></AD_MODEL_OBJECT_ID>
+<!--9382FCA58F5DAF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F5DAF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F5DAF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F5DAF36E040A8C021013A93-->  <ACTION><![CDATA[W]]></ACTION>
+<!--9382FCA58F5DAF36E040A8C021013A93-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--9382FCA58F5DAF36E040A8C021013A93-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.ComboReloads40207FE1E4F94FDDA026C37C4E1E1847]]></CLASSNAME>
+<!--9382FCA58F5DAF36E040A8C021013A93-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--9382FCA58F5DAF36E040A8C021013A93-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--9382FCA58F5DAF36E040A8C021013A93--></AD_MODEL_OBJECT>
+
 <!--96ED899EC5704BA9961340A934B62133--><AD_MODEL_OBJECT>
 <!--96ED899EC5704BA9961340A934B62133-->  <AD_MODEL_OBJECT_ID><![CDATA[96ED899EC5704BA9961340A934B62133]]></AD_MODEL_OBJECT_ID>
 <!--96ED899EC5704BA9961340A934B62133-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -27410,6 +27410,46 @@
 <!--9178E3E031F8731CE040007F01004675-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
 <!--9178E3E031F8731CE040007F01004675--></AD_MODEL_OBJECT_MAPPING>
 
+<!--9382FCA58F5AAF36E040A8C021013A93--><AD_MODEL_OBJECT_MAPPING>
+<!--9382FCA58F5AAF36E040A8C021013A93-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[9382FCA58F5AAF36E040A8C021013A93]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--9382FCA58F5AAF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F5AAF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F5AAF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F5AAF36E040A8C021013A93-->  <AD_MODEL_OBJECT_ID><![CDATA[9382FCA58F59AF36E040A8C021013A93]]></AD_MODEL_OBJECT_ID>
+<!--9382FCA58F5AAF36E040A8C021013A93-->  <MAPPINGNAME><![CDATA[/Module/Merges_Relation.html]]></MAPPINGNAME>
+<!--9382FCA58F5AAF36E040A8C021013A93-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--9382FCA58F5AAF36E040A8C021013A93--></AD_MODEL_OBJECT_MAPPING>
+
+<!--9382FCA58F5BAF36E040A8C021013A93--><AD_MODEL_OBJECT_MAPPING>
+<!--9382FCA58F5BAF36E040A8C021013A93-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[9382FCA58F5BAF36E040A8C021013A93]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--9382FCA58F5BAF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F5BAF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F5BAF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F5BAF36E040A8C021013A93-->  <AD_MODEL_OBJECT_ID><![CDATA[9382FCA58F59AF36E040A8C021013A93]]></AD_MODEL_OBJECT_ID>
+<!--9382FCA58F5BAF36E040A8C021013A93-->  <MAPPINGNAME><![CDATA[/Module/Merges_Edition.html]]></MAPPINGNAME>
+<!--9382FCA58F5BAF36E040A8C021013A93-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--9382FCA58F5BAF36E040A8C021013A93--></AD_MODEL_OBJECT_MAPPING>
+
+<!--9382FCA58F5CAF36E040A8C021013A93--><AD_MODEL_OBJECT_MAPPING>
+<!--9382FCA58F5CAF36E040A8C021013A93-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[9382FCA58F5CAF36E040A8C021013A93]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--9382FCA58F5CAF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F5CAF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F5CAF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F5CAF36E040A8C021013A93-->  <AD_MODEL_OBJECT_ID><![CDATA[9382FCA58F59AF36E040A8C021013A93]]></AD_MODEL_OBJECT_ID>
+<!--9382FCA58F5CAF36E040A8C021013A93-->  <MAPPINGNAME><![CDATA[/Module/Merges_Excel.xls]]></MAPPINGNAME>
+<!--9382FCA58F5CAF36E040A8C021013A93-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--9382FCA58F5CAF36E040A8C021013A93--></AD_MODEL_OBJECT_MAPPING>
+
+<!--9382FCA58F5EAF36E040A8C021013A93--><AD_MODEL_OBJECT_MAPPING>
+<!--9382FCA58F5EAF36E040A8C021013A93-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[9382FCA58F5EAF36E040A8C021013A93]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--9382FCA58F5EAF36E040A8C021013A93-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9382FCA58F5EAF36E040A8C021013A93-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9382FCA58F5EAF36E040A8C021013A93-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9382FCA58F5EAF36E040A8C021013A93-->  <AD_MODEL_OBJECT_ID><![CDATA[9382FCA58F5DAF36E040A8C021013A93]]></AD_MODEL_OBJECT_ID>
+<!--9382FCA58F5EAF36E040A8C021013A93-->  <MAPPINGNAME><![CDATA[/ad_callouts/ComboReloads40207FE1E4F94FDDA026C37C4E1E1847.html]]></MAPPINGNAME>
+<!--9382FCA58F5EAF36E040A8C021013A93-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--9382FCA58F5EAF36E040A8C021013A93--></AD_MODEL_OBJECT_MAPPING>
+
 <!--9456012F208C4AAC9FC746B9C4F3429A--><AD_MODEL_OBJECT_MAPPING>
 <!--9456012F208C4AAC9FC746B9C4F3429A-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[9456012F208C4AAC9FC746B9C4F3429A]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--9456012F208C4AAC9FC746B9C4F3429A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TAB.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_TAB.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -12849,6 +12849,30 @@
 <!--3ED38B380CD849B38F0AC1B52F992C34-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
 <!--3ED38B380CD849B38F0AC1B52F992C34--></AD_TAB>
 
+<!--40207FE1E4F94FDDA026C37C4E1E1847--><AD_TAB>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <AD_TAB_ID><![CDATA[40207FE1E4F94FDDA026C37C4E1E1847]]></AD_TAB_ID>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <NAME><![CDATA[Merges]]></NAME>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <DESCRIPTION><![CDATA[Contains the list of modules merged by the current one.]]></DESCRIPTION>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <HELP><![CDATA[Modules can merge other ones. This table contains information about the merges. A module should be merged in a new major version and once it is merged it should be kept in all future versions. When there is a module merged, multiple DBPrefixes are allowed to maintain the one originally defined by the module as well as all the ones defined in the merged modules.]]></HELP>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <AD_WINDOW_ID><![CDATA[D586192D06C14EC182B44CAD34CA4295]]></AD_WINDOW_ID>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <TABLEVEL><![CDATA[1]]></TABLEVEL>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <ISINFOTAB><![CDATA[N]]></ISINFOTAB>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <ISTRANSLATIONTAB><![CDATA[N]]></ISTRANSLATIONTAB>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <HASTREE><![CDATA[N]]></HASTREE>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <PROCESSING><![CDATA[N]]></PROCESSING>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--40207FE1E4F94FDDA026C37C4E1E1847-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
+<!--40207FE1E4F94FDDA026C37C4E1E1847--></AD_TAB>
+
 <!--449063A42EFD4B80A0A6D415684C8BC4--><AD_TAB>
 <!--449063A42EFD4B80A0A6D415684C8BC4-->  <AD_TAB_ID><![CDATA[449063A42EFD4B80A0A6D415684C8BC4]]></AD_TAB_ID>
 <!--449063A42EFD4B80A0A6D415684C8BC4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TABLE.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_TABLE.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -9916,6 +9916,29 @@
 <!--0DF2FECF5F054A1791A89A86709BC6C6-->  <AD_PACKAGE_ID><![CDATA[5A3ED54AB1CE4B84E040007F01006125]]></AD_PACKAGE_ID>
 <!--0DF2FECF5F054A1791A89A86709BC6C6--></AD_TABLE>
 
+<!--0EA05A734BA74DDB873CE8DA4BB52473--><AD_TABLE>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <AD_TABLE_ID><![CDATA[0EA05A734BA74DDB873CE8DA4BB52473]]></AD_TABLE_ID>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <NAME><![CDATA[ADModuleMerge]]></NAME>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <DESCRIPTION><![CDATA[Contains the list of modules merged by the current one.]]></DESCRIPTION>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <HELP><![CDATA[Modules can merge other ones. This table contains information about the merges. A module should be merged in a new major version and once it is merged it should be kept in all future versions. When there is a module merged, multiple DBPrefixes are allowed to maintain the one originally defined by the module as well as all the ones defined in the merged modules.]]></HELP>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <TABLENAME><![CDATA[AD_Module_Merge]]></TABLENAME>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <CLASSNAME><![CDATA[ModuleMerge]]></CLASSNAME>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <ISVIEW><![CDATA[N]]></ISVIEW>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <ACCESSLEVEL><![CDATA[4]]></ACCESSLEVEL>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <AD_WINDOW_ID><![CDATA[D586192D06C14EC182B44CAD34CA4295]]></AD_WINDOW_ID>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <ISSECURITYENABLED><![CDATA[N]]></ISSECURITYENABLED>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <ISDELETEABLE><![CDATA[Y]]></ISDELETEABLE>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <ISHIGHVOLUME><![CDATA[N]]></ISHIGHVOLUME>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <IMPORTTABLE><![CDATA[N]]></IMPORTTABLE>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <ISCHANGELOG><![CDATA[N]]></ISCHANGELOG>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <ISDEFAULTACCT><![CDATA[N]]></ISDEFAULTACCT>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--0EA05A734BA74DDB873CE8DA4BB52473-->  <AD_PACKAGE_ID><![CDATA[5A3ED54AB1CC4B84E040007F01006125]]></AD_PACKAGE_ID>
+<!--0EA05A734BA74DDB873CE8DA4BB52473--></AD_TABLE>
+
 <!--1F17CA14C9D04D1D99DB72BE2E4C585C--><AD_TABLE>
 <!--1F17CA14C9D04D1D99DB72BE2E4C585C-->  <AD_TABLE_ID><![CDATA[1F17CA14C9D04D1D99DB72BE2E4C585C]]></AD_TABLE_ID>
 <!--1F17CA14C9D04D1D99DB72BE2E4C585C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -21395,6 +21395,28 @@
 <!--93871158F2B811DDADFC001D09C4A2FE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--93871158F2B811DDADFC001D09C4A2FE--></AD_TEXTINTERFACES>
 
+<!--939870600E69E1B7E040A8C02101366B--><AD_TEXTINTERFACES>
+<!--939870600E69E1B7E040A8C02101366B-->  <AD_TEXTINTERFACES_ID><![CDATA[939870600E69E1B7E040A8C02101366B]]></AD_TEXTINTERFACES_ID>
+<!--939870600E69E1B7E040A8C02101366B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--939870600E69E1B7E040A8C02101366B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--939870600E69E1B7E040A8C02101366B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--939870600E69E1B7E040A8C02101366B-->  <TEXT><![CDATA[Merged Module(s):]]></TEXT>
+<!--939870600E69E1B7E040A8C02101366B-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP1.html]]></FILENAME>
+<!--939870600E69E1B7E040A8C02101366B-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--939870600E69E1B7E040A8C02101366B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--939870600E69E1B7E040A8C02101366B--></AD_TEXTINTERFACES>
+
+<!--939870600E6BE1B7E040A8C02101366B--><AD_TEXTINTERFACES>
+<!--939870600E6BE1B7E040A8C02101366B-->  <AD_TEXTINTERFACES_ID><![CDATA[939870600E6BE1B7E040A8C02101366B]]></AD_TEXTINTERFACES_ID>
+<!--939870600E6BE1B7E040A8C02101366B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--939870600E6BE1B7E040A8C02101366B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--939870600E6BE1B7E040A8C02101366B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--939870600E6BE1B7E040A8C02101366B-->  <TEXT><![CDATA[Please note: The following modules will be uninstalled as they are now merged within other modules.]]></TEXT>
+<!--939870600E6BE1B7E040A8C02101366B-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP1.html]]></FILENAME>
+<!--939870600E6BE1B7E040A8C02101366B-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--939870600E6BE1B7E040A8C02101366B-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--939870600E6BE1B7E040A8C02101366B--></AD_TEXTINTERFACES>
+
 <!--93AE8790C6A45EF7E040007F010073E2--><AD_TEXTINTERFACES>
 <!--93AE8790C6A45EF7E040007F010073E2-->  <AD_TEXTINTERFACES_ID><![CDATA[93AE8790C6A45EF7E040007F010073E2]]></AD_TEXTINTERFACES_ID>
 <!--93AE8790C6A45EF7E040007F010073E2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -21549,6 +21571,17 @@
 <!--9438F45D86CA3928E040007F01005A67-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--9438F45D86CA3928E040007F01005A67--></AD_TEXTINTERFACES>
 
+<!--94C751F6BF0B248CE040A8C021012D64--><AD_TEXTINTERFACES>
+<!--94C751F6BF0B248CE040A8C021012D64-->  <AD_TEXTINTERFACES_ID><![CDATA[94C751F6BF0B248CE040A8C021012D64]]></AD_TEXTINTERFACES_ID>
+<!--94C751F6BF0B248CE040A8C021012D64-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--94C751F6BF0B248CE040A8C021012D64-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--94C751F6BF0B248CE040A8C021012D64-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--94C751F6BF0B248CE040A8C021012D64-->  <TEXT><![CDATA[ merged into ]]></TEXT>
+<!--94C751F6BF0B248CE040A8C021012D64-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP1.html]]></FILENAME>
+<!--94C751F6BF0B248CE040A8C021012D64-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--94C751F6BF0B248CE040A8C021012D64-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--94C751F6BF0B248CE040A8C021012D64--></AD_TEXTINTERFACES>
+
 <!--9F0C2175AC6145B49570E24110762368--><AD_TEXTINTERFACES>
 <!--9F0C2175AC6145B49570E24110762368-->  <AD_TEXTINTERFACES_ID><![CDATA[9F0C2175AC6145B49570E24110762368]]></AD_TEXTINTERFACES_ID>
 <!--9F0C2175AC6145B49570E24110762368-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-wad/src/org/openbravo/wad/validation/WADValidator_data.xsql	Thu Nov 11 16:32:10 2010 +0100
+++ b/src-wad/src/org/openbravo/wad/validation/WADValidator_data.xsql	Thu Nov 11 18:11:49 2010 +0100
@@ -209,16 +209,20 @@
     <SqlMethod name="checkColumnName" type="preparedStatement" return="multiple">
     <Sql>
       <![CDATA[
-           select t.tablename||'.'||c.columnname as objectName, 'DB Column Name' as objectType, c.columnname as currentValue, dbp.name as expectedvalue, m.name as moduleName
-          from ad_table t, ad_module m, ad_package p, ad_column c, ad_module_dbprefix dbp
+           select t.tablename||'.'||c.columnname as objectName, 'DB Column Name' as objectType, c.columnname as currentValue, 
+           (select max(name) 
+              from AD_Module_DBPrefix dbp
+             where dbp.AD_Module_ID = c.AD_Module_ID) as expectedvalue, 
+           m.name as moduleName
+          from ad_table t, ad_module m, ad_package p, ad_column c
          where t.ad_package_id = p.ad_package_id
            and t.ad_table_id = c.ad_table_id
            and c.ad_module_id != p.ad_module_id
            and m.ad_module_id = c.ad_module_id
-           and dbp.ad_module_id = c.ad_module_id
            and not exists (select 1 
-                             from dual
-                            where instr(upper(c.columnname), 'EM_'||upper(dbp.name)||'_') = 1)
+                             from ad_module_dbprefix dbp
+                            where instr(upper(c.columnname), 'EM_'||upper(dbp.name)||'_') = 1
+                              and dbp.ad_module_id = c.ad_module_id)
            AND NOT EXISTS( SELECT 1
                              FROM AD_EXCEPTIONS
                              WHERE TYPE='COLUMN'
@@ -226,16 +230,20 @@
                              AND UPPER(NAME1)=UPPER(c.Columnname)) 
            and (1=1 and m.javapackage in ('1') or to_char('Y')=to_char(?))
     union
-        select t.tablename||'.'||c.columnname as objectName, 'Name' as objectType, to_char(c.name) as currentValue, dbp.name as expectedvalue, m.name as moduleName
-          from ad_table t, ad_module m, ad_package p, ad_column c, ad_module_dbprefix dbp
+        select t.tablename||'.'||c.columnname as objectName, 'Name' as objectType, to_char(c.name) as currentValue, 
+        (select max(name) 
+              from AD_Module_DBPrefix dbp
+             where dbp.AD_Module_ID = c.AD_Module_ID) as expectedvalue, 
+        m.name as moduleName
+          from ad_table t, ad_module m, ad_package p, ad_column c
          where t.ad_package_id = p.ad_package_id
            and t.ad_table_id = c.ad_table_id
            and c.ad_module_id != p.ad_module_id
            and m.ad_module_id = c.ad_module_id
-           and dbp.ad_module_id = c.ad_module_id
            and not exists (select 1 
-                             from dual
-                            where instr(upper(c.name), 'EM_'||upper(dbp.name)||'_') = 1)
+                             from ad_module_dbprefix dbp
+                            where instr(upper(c.name), 'EM_'||upper(dbp.name)||'_') = 1
+                              and dbp.ad_module_id = c.ad_module_id)
            AND NOT EXISTS( SELECT 1
                              FROM AD_EXCEPTIONS
                              WHERE TYPE='COLUMN'
@@ -254,12 +262,16 @@
   <SqlMethod name="checkAuxiliarInput" type="preparedStatement" return="multiple">
     <Sql>
       <![CDATA[
-        select i.name as objectName, p.name as expectedvalue
-          from ad_auxiliarInput i, AD_Module_DBPrefix p, AD_Module m
-         where p.AD_Module_ID = i.AD_Module_ID
-           and i.ad_module_id != '0'
+        select i.name as objectName, (select max(name) 
+                                       from AD_Module_DBPrefix p
+                                      where p.AD_Module_ID = i.AD_Module_ID) as expectedvalue
+          from ad_auxiliarInput i, AD_Module m
+         where i.ad_module_id != '0'
            and m.ad_module_id = i.ad_module_id
-           and instr(upper(i.NAME), upper(p.name)||'_') != 1
+           and exists (select 1 
+                         from AD_Module_DBPrefix p
+                        where p.AD_Module_ID = i.AD_Module_ID
+                          and instr(upper(i.NAME), upper(p.name)||'_') != 1)
            and (m.javapackage in ('1') or to_char('Y')=to_char(?))
       ]]>
     </Sql>
--- a/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java	Thu Nov 11 16:32:10 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java	Thu Nov 11 18:11:49 2010 +0100
@@ -639,7 +639,7 @@
       VariablesSecureApp vars, String recordId, boolean islocal, InputStream obx,
       String[] updateModules, HashMap<String, String> maturityLevels) throws IOException,
       ServletException {
-    final String discard[] = { "", "", "", "", "", "", "warnMaturity" };
+    final String discard[] = { "", "", "", "", "", "", "warnMaturity", "" };
     Module module = null;
 
     // Remote installation is only allowed for heartbeat enabled instances
@@ -680,6 +680,7 @@
 
     Module[] inst = null;
     Module[] upd = null;
+    Module[] merges = null;
     OBError message = null;
     boolean found = false;
     boolean check = false;
@@ -786,6 +787,18 @@
             }
           }
         }
+        // Add additional messages that can come from CR
+        OBError additionalMsg = im.getCheckError();
+        if (!additionalMsg.getMessage().isEmpty()) {
+          if (message == null) {
+            message = new OBError();
+            message.setType("Info");
+            message.setTitle(Utility.messageBD(this, message.getType(), vars.getLanguage()));
+          } else {
+            message.setMessage(message.getMessage() + "\n");
+          }
+          message.setMessage(message.getMessage() + additionalMsg.getMessage());
+        }
 
       } else { // Dependencies not satisfied, do not show continue button
         message = im.getCheckError();
@@ -808,6 +821,11 @@
         discard[3] = "discardAdditional";
         discard[5] = "discardContinue";
       }
+
+      merges = im.getModulesToMerge();
+      if (merges == null || merges.length == 0) {
+        discard[7] = "mergeModules";
+      }
     } catch (final Exception e) {
       log4j.error(e.getMessage(), e);
       message = new OBError();
@@ -831,6 +849,10 @@
           .getLanguage(), islocal));
     }
 
+    if (merges != null && merges.length > 0) {
+      xmlDocument.setData("merges", getMergesFieldProvider(merges));
+    }
+
     xmlDocument.setParameter("inpLocalInstall", islocal ? "Y" : "N");
 
     if (!islocal && module != null) {
@@ -861,6 +883,22 @@
     out.close();
   }
 
+  /**
+   * Obtains a FieldProvider to display the merged modules.
+   */
+  private FieldProvider[] getMergesFieldProvider(Module[] merges) {
+    List<Map<String, String>> rt = new ArrayList<Map<String, String>>();
+
+    for (Module merge : merges) {
+      Map<String, String> mod = new HashMap<String, String>();
+      mod.put("mergedModule", merge.getName());
+      mod.put("mergedWith", (String) merge.getAdditionalInfo().get("mergedWith"));
+      rt.add(mod);
+    }
+
+    return FieldProviderFactory.getFieldProviderArray(rt);
+  }
+
   private FieldProvider[] getModuleFieldProvider(Module[] inst, Map<String, String> minVersions,
       boolean installed, String lang, boolean islocal) {
     ArrayList<HashMap<String, String>> rt = new ArrayList<HashMap<String, String>>();
--- a/src/org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP1.html	Thu Nov 11 16:32:10 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP1.html	Thu Nov 11 18:11:49 2010 +0100
@@ -250,6 +250,17 @@
                       <div style="height: 10px;"></div>
                     </FIELD_TMP>
                   </FIELD_TMP>
+                  <FIELD_TMP id="mergeModules">
+                    <div class="Label_ReadOnly_Text" style="color: orange;">Merged Module(s):</div>
+                    <div class="Label_ReadOnly_Text" style="color: orange;">Please note: The following modules will be uninstalled as they are now merged within other modules.</div>
+                    <div style="height: 10px;"></div>
+                    <FIELD_TMP id="mergeList">
+                      <div class="PlainText_normal" style="color: orange;">
+                        <b><span id="mergedModule">xxmoduleMerged</span></b>&nbsp;merged into&nbsp;<span id="mergedWith">xxmoduleMerger</span> 
+                      </div>
+                      <div style="height: 10px;"></div>
+                    </FIELD_TMP>
+                  </FIELD_TMP>
                 </div>
               </td>
             </tr>
--- a/src/org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP1.xml	Thu Nov 11 16:32:10 2010 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP1.xml	Thu Nov 11 18:11:49 2010 +0100
@@ -58,4 +58,10 @@
     <FIELD id="maturityLevelUpdate" default="">maturityLevel</FIELD>
     <SECTION id="updtList"/>
   </structure>
+  
+  <structure name="merges">
+    <FIELD id="mergedModule">mergedModule</FIELD>
+    <FIELD id="mergedWith">mergedWith</FIELD>
+    <SECTION id="mergeList"/>
+  </structure>
 </REPORT>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/modules/CheckLocalConsistency.java	Thu Nov 11 18:11:49 2010 +0100
@@ -0,0 +1,63 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html 
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License. 
+ * The Original Code is Openbravo ERP. 
+ * The Initial Developer of the Original Code is Openbravo SLU 
+ * All portions are Copyright (C) 2010 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.erpCommon.modules;
+
+import org.apache.log4j.Logger;
+import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.core.DalInitializingTask;
+import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.service.db.DalConnectionProvider;
+import org.openbravo.services.webservice.Module;
+
+public class CheckLocalConsistency extends DalInitializingTask {
+  private static final Logger log4j = Logger.getLogger(CheckLocalConsistency.class);
+
+  @Override
+  protected void doExecute() {
+    VariablesSecureApp vars = new VariablesSecureApp("0", "0", "0");
+
+    OBError msg = new OBError();
+
+    try {
+      Module[] modulesToInstall = new Module[0];
+      Module[] modulesToUpdate = new Module[0];
+      Module[] modulesToMerge = new Module[0];
+
+      VersionUtility.setPool(new DalConnectionProvider());
+
+      boolean checked = VersionUtility.checkLocal(vars, modulesToInstall, modulesToUpdate,
+          modulesToMerge, msg);
+      if (checked) {
+        System.out.println("Local Dependencies are OK");
+        System.out.println("=========================");
+
+      } else {
+        System.out.println("Local Dependencies are not satisfied");
+        System.out.println("====================================\n");
+
+        System.out.println(msg.getMessage());
+      }
+    } catch (Exception e) {
+      log4j.error("Error", e);
+    }
+
+  }
+
+}
--- a/src/org/openbravo/erpCommon/modules/ImportModule.java	Thu Nov 11 16:32:10 2010 +0100
+++ b/src/org/openbravo/erpCommon/modules/ImportModule.java	Thu Nov 11 18:11:49 2010 +0100
@@ -35,8 +35,10 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 import java.util.Vector;
+import java.util.Map.Entry;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
@@ -62,6 +64,7 @@
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.core.OBInterceptor;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.database.ConnectionProvider;
@@ -108,6 +111,7 @@
   // not satisfied
   private Module[] modulesToInstall = null;
   private Module[] modulesToUpdate = null;
+  private Module[] modulesToMerge = null;
   private StringBuffer log = new StringBuffer();
   private int logLevel = 0;
   VariablesSecureApp vars;
@@ -138,10 +142,11 @@
     vars = _vars;
     obDir = obdir;
     pool = conn;
-    final File[] files = new File[3];
+    final File[] files = new File[4];
     files[0] = new File(obDir + "/src-db/database/model/tables/AD_MODULE.xml");
     files[1] = new File(obDir + "/src-db/database/model/tables/AD_MODULE_DEPENDENCY.xml");
     files[2] = new File(obDir + "/src-db/database/model/tables/AD_MODULE_DBPREFIX.xml");
+    files[3] = new File(obDir + "/src-db/database/model/tables/AD_MODULE_MERGE.xml");
 
     verifyFilesExist(files);
 
@@ -163,6 +168,8 @@
   /**
    * Check the dependencies for a file name. See
    * {@link #checkDependenciesId(String[], String[], HashMap)}.
+   * 
+   * @deprecated not used
    */
   public boolean checkDependenciesFileName(String fileName) throws Exception {
     final File file = new File(fileName);
@@ -184,7 +191,8 @@
 
     boolean isUpdate = false;
     final Vector<DynaBean> modulesInObx = new Vector<DynaBean>();
-    getModulesFromObx(modulesInObx, dependencies, dbprefix, is);
+    getModulesFromObx(modulesInObx, dependencies, dbprefix, is, new HashMap<String, String>());
+    // don't care about merges at this stage
 
     for (final DynaBean module : modulesInObx) {
 
@@ -209,47 +217,59 @@
   }
 
   /**
-   * Check the dependencies for a file. See
-   * {@link #checkDependenciesId(String[], String[], HashMap)}.
+   * Check the dependencies for a file. Used only for local installation from obx file.
+   * 
+   * @see {@link #checkDependenciesId(String[], String[], HashMap)}.
    */
   public boolean checkDependenciesFile(InputStream file) throws Exception {
-    if (installLocally) {
-      final Vector<DynaBean> modulesInObx = new Vector<DynaBean>();
-      getModulesFromObx(modulesInObx, dependencies, dbprefix, file);
 
-      for (final DynaBean module : modulesInObx) {
+    final Vector<DynaBean> modulesInObx = new Vector<DynaBean>();
+    Map<String, String> merges = new HashMap<String, String>();
 
-        String moduleId = (String) module.get("AD_MODULE_ID");
-        String version = (String) module.get("VERSION");
+    getModulesFromObx(modulesInObx, dependencies, dbprefix, file, merges);
 
-        if (ImportModuleData.moduleInstalled(pool, moduleId)) {
-          String installedVersion = ImportModuleData.selectVersion(pool, moduleId);
-          VersionUtility.VersionComparator comparator = new VersionUtility.VersionComparator();
-          if (comparator.compare(version, installedVersion) > 0) {
-            dynModulesToUpdate.add(module);
-          }
-        } else {
-          dynModulesToInstall.add(module);
+    for (final DynaBean module : modulesInObx) {
+
+      String moduleId = (String) module.get("AD_MODULE_ID");
+      String version = (String) module.get("VERSION");
+
+      if (ImportModuleData.moduleInstalled(pool, moduleId)) {
+        String installedVersion = ImportModuleData.selectVersion(pool, moduleId);
+        VersionUtility.VersionComparator comparator = new VersionUtility.VersionComparator();
+        if (comparator.compare(version, installedVersion) > 0) {
+          dynModulesToUpdate.add(module);
         }
+      } else {
+        dynModulesToInstall.add(module);
       }
+    }
 
-      modulesToInstall = dyanaBeanToModules(dynModulesToInstall, dependencies);
-      modulesToUpdate = dyanaBeanToModules(dynModulesToUpdate, dependencies);
-      errors = new OBError();
-      checked = VersionUtility.checkLocal(vars, modulesToInstall, modulesToUpdate, errors);
-    } else {
-      // if it is a remote installation for a file, just take the first
-      // module and
-      // pull the rest of them
+    modulesToInstall = dyanaBeanToModules(dynModulesToInstall, dependencies);
+    modulesToUpdate = dyanaBeanToModules(dynModulesToUpdate, dependencies);
 
-      getModulesFromObx(dynModulesToInstall, dependencies, new Vector<DynaBean>(), file);
-      final String[] installableModules = new String[1];
-      installableModules[0] = (String) dynModulesToInstall.get(0).get("AD_MODULE_ID");
-      HashMap<String, String> maturityLevels = new HashMap<String, String>();
-      maturityLevels.put("update.level", "500");
-      maturityLevels.put("install.level", "500");
-      checkDependenciesId(installableModules, new String[0], maturityLevels);
+    // Check merges
+    List<Module> mergesList = new ArrayList<Module>();
+    for (Entry<String, String> merge : merges.entrySet()) {
+      org.openbravo.model.ad.module.Module mergedDALModule = OBDal.getInstance().get(
+          org.openbravo.model.ad.module.Module.class, merge.getKey());
+      if (mergedDALModule != null) {
+        // Merged module is installed locally, add it as merge to uninstall. In case it is not
+        // installed, it does not make sense to show any message to user.
+        Module mergedModule = getWsModuleFromDalModule(mergedDALModule);
+        HashMap<String, String> additionalInfo = new HashMap<String, String>();
+        additionalInfo.put("remove", "true");
+        additionalInfo.put("mergedWith", getMergedWith(merge.getValue()));
+        mergedModule.setAdditionalInfo(additionalInfo);
+        mergesList.add(mergedModule);
+      }
     }
+
+    modulesToMerge = mergesList.toArray(new Module[0]);
+
+    errors = new OBError();
+    checked = VersionUtility.checkLocal(vars, modulesToInstall, modulesToUpdate, modulesToMerge,
+        errors);
+
     if (antInstall) {
       printAntDependenciesLog();
     }
@@ -282,30 +302,87 @@
 
     // In case core is in the list of modules to update, put in at the last module to update, so it
     // will be updated only in case the rest of modules were successfully downloaded and updated.
-    Module[] updateModuleAux = mid.getModulesToUpdate();
-    modulesToUpdate = new Module[updateModuleAux.length];
-    int i = 0;
+    List<Module> updates = new ArrayList<Module>();
+    List<Module> merges = new ArrayList<Module>();
+
     boolean updatingCore = false;
     Module core = null;
-    for (Module module : updateModuleAux) {
+    for (Module module : mid.getModulesToUpdate()) {
       if (!module.getModuleID().equals("0")) {
-        modulesToUpdate[i] = module;
-        i++;
+        if ("true".equals(module.getAdditionalInfo().get("remove"))) {
+          merges.add(module);
+        } else {
+          updates.add(module);
+        }
       } else {
         updatingCore = true;
         core = module;
       }
     }
     if (updatingCore) {
-      modulesToUpdate[i] = core;
+      updates.add(core);
     }
 
+    modulesToUpdate = updates.toArray(new Module[0]);
+    modulesToMerge = merges.toArray(new Module[0]);
+
     checked = mid.isValidConfiguration();
 
     return checked;
   }
 
   /**
+   * Obtains a new {@link Module} from a {@link org.openbravo.model.ad.module.Module DAL Module}
+   * 
+   * @param dalModule
+   *          Original DAL module to convert
+   * @return new Module based on DAL module
+   */
+  private Module getWsModuleFromDalModule(org.openbravo.model.ad.module.Module dalModule) {
+    Module rt = new Module();
+    rt.setModuleID(dalModule.getId());
+    rt.setName(dalModule.getName());
+    rt.setVersionNo(dalModule.getVersion());
+    return rt;
+  }
+
+  /**
+   * Obtains the text to show for merged modules about the module that is merged within.
+   * 
+   * @param moduleId
+   * @return
+   */
+  private String getMergedWith(String moduleId) {
+    boolean found = false;
+    Module mergedWith = null;
+
+    for (Module module : modulesToInstall) {
+      if (moduleId.equals(module.getModuleID())) {
+        found = true;
+        mergedWith = module;
+        break;
+      }
+    }
+
+    if (!found) {
+      for (Module module : modulesToUpdate) {
+        if (moduleId.equals(module.getModuleID())) {
+          found = true;
+          mergedWith = module;
+          break;
+        }
+      }
+    }
+
+    if (found) {
+      return mergedWith.getName() + " " + mergedWith.getVersionNo();
+    } else {
+      // This shouldn't happen, the merging module should be found
+      return "??";
+    }
+  }
+
+  /**
    * @deprecated Use {@link ImportModule#checkDependenciesId(String[], String[], HashMap)} instead
    */
   public boolean checkDependenciesId(String[] installableModules, String[] updateableModules)
@@ -357,6 +434,11 @@
               return;
             }
           }
+          for (Module module : modulesToMerge) {
+            if (!prepareUpdate(module)) {
+              return;
+            }
+          }
 
           // Just pick the first module, to install/update as the rest of them are inside the obx
           // file
@@ -364,6 +446,8 @@
               : modulesToUpdate[0];
           installLocalModule(module, file,
               (modulesToInstall != null && modulesToInstall.length > 0));
+
+          uninstallMerges();
         } else { // install remotely
           execute();
         }
@@ -524,6 +608,7 @@
    * {@link ImportModule#installLocalModule(Module, InputStream, boolean)} method.
    */
   private void installAllModules() {
+    // Do installation of new modules
     for (Module module : modulesToInstall) {
       InputStream obx = getTemporaryOBX(module);
       if (obx == null || !installLocalModule(module, obx, true)) {
@@ -531,19 +616,58 @@
       }
     }
 
+    // Do installation of updates
     for (Module module : modulesToUpdate) {
-      InputStream obx = getTemporaryOBX(module);
       if (!prepareUpdate(module)) {
         return;
       }
+      InputStream obx = getTemporaryOBX(module);
       if (obx == null || !installLocalModule(module, obx, false)) {
         return;
       }
     }
+
+    for (Module module : modulesToMerge) {
+      // saves copy of files and removes module directory
+      if (!prepareUpdate(module)) {
+        return;
+      }
+    }
+
+    uninstallMerges();
+
     insertDBLog();
   }
 
   /**
+   * All modules marked as merged will be uninsntalled, the module directory should have been
+   * already removed, so it is only pending to set the module as uninstalled
+   */
+  private void uninstallMerges() {
+    if (modulesToMerge == null) {
+      return;
+    }
+
+    // do not update the audit info here, as its a local config change, which should not be
+    // treated as 'local changes' by i.e. update.database
+    try {
+      OBInterceptor.setPreventUpdateInfoChange(true);
+      for (Module module : modulesToMerge) {
+        // to uninstall, it is only pending to set status in DB
+        org.openbravo.model.ad.module.Module mod = OBDal.getInstance().get(
+            org.openbravo.model.ad.module.Module.class, module.getModuleID());
+        if (mod != null) {
+          mod.setStatus("U");
+          addLog("@MergeUninstalled@ " + mod.getName(), MSG_SUCCESS);
+        }
+      }
+      OBDal.getInstance().flush();
+    } finally {
+      OBInterceptor.setPreventUpdateInfoChange(false);
+    }
+  }
+
+  /**
    * Reads in the tmp directory the obx file and returns it as an InputStream.
    */
   private InputStream getTemporaryOBX(Module module) {
@@ -690,6 +814,13 @@
   }
 
   /**
+   * Returns the list of modules to merge. This list is set by one of the checkDependencies methods.
+   */
+  public Module[] getModulesToMerge() {
+    return modulesToMerge;
+  }
+
+  /**
    * Returns the list of errors. This list is set by one of the checkDependencies methods. A list of
    * errors is returned in case the selected modules cannot be installed because dependencies are
    * not satisfied.
@@ -833,6 +964,34 @@
         }
       }
     }
+
+    for (Module module : modulesToMerge) {
+      ImportModuleData moduleInDB = null;
+      try {
+        moduleInDB = ImportModuleData.getModule(pool, module.getModuleID());
+      } catch (Exception e) {
+        log4j.error("Error reading DB", e);
+      }
+
+      String backupFileName = obDir + "/backup_install/" + moduleInDB.javapackage + "-"
+          + moduleInDB.version + ".zip";
+      File backupFile = new File(backupFileName);
+      if (!backupFile.exists()) {
+        continue;
+      }
+      try {
+        File moduleDir = new File(obDir + "/modules/" + module.getPackageName());
+        if (moduleDir.exists()) {
+          log4j.info("Deleting " + module.getPackageName() + " to restore bakcup...");
+          Utility.deleteDir(new File(obDir + "/modules/" + module.getPackageName()));
+        }
+        log4j.info("Restoring " + backupFileName);
+        Zip.unzip(backupFileName, obDir + "/modules/" + module.getPackageName());
+
+      } catch (final Exception e) {
+        log4j.error("Error restoring " + module.getName(), e);
+      }
+    }
   }
 
   /**
@@ -873,7 +1032,7 @@
       logLevel = level;
       log = new StringBuffer(m);
     } else if (level == logLevel)
-      log.append(m + "\n");
+      log.append(m + "<br>\n");
   }
 
   /**
@@ -1145,23 +1304,28 @@
    * @param dModulesToInstall
    * @param dDependencies
    * @param obx
+   * @param merges
+   *          (output param) It contains all the merges defines in the obx as
+   *          (MergedModuleId,MergedBy)
    * @throws Exception
    */
   private void getModulesFromObx(Vector<DynaBean> dModulesToInstall,
-      Vector<DynaBean> dDependencies, Vector<DynaBean> dDBprefix, InputStream obx) throws Exception {
+      Vector<DynaBean> dDependencies, Vector<DynaBean> dDBprefix, InputStream obx,
+      Map<String, String> merges) throws Exception {
     final ZipInputStream obxInputStream = new ZipInputStream(obx);
     ZipEntry entry = null;
     boolean foundAll = false;
     boolean foundModule = false;
     boolean foundDependency = false;
     boolean foundPrefix = false;
+    boolean foundMerge = false;
     while (((entry = obxInputStream.getNextEntry()) != null) && !foundAll) {
 
       if (entry.getName().endsWith(".obx")) {
         // If it is a new module, install it
         final ByteArrayInputStream ba = getCurrentEntryStream(obxInputStream);
         obxInputStream.closeEntry();
-        getModulesFromObx(dModulesToInstall, dDependencies, dDBprefix, ba);
+        getModulesFromObx(dModulesToInstall, dDependencies, dDBprefix, ba, merges);
       } else if (entry.getName().replace("\\", "/").endsWith(
           "src-db/database/sourcedata/AD_MODULE.xml")) {
         final Vector<DynaBean> module = getEntryDynaBeans(getBytesCurrentEntryStream(obxInputStream));
@@ -1182,9 +1346,18 @@
         dDBprefix.addAll(getEntryDynaBeans(getBytesCurrentEntryStream(obxInputStream)));
         obxInputStream.closeEntry();
         foundPrefix = true;
-      } else
+      } else if (entry.getName().replace("\\", "/").endsWith(
+          "/src-db/database/sourcedata/AD_MODULE_MERGE.xml")) {
+        Vector<DynaBean> dynMerges = getEntryDynaBeans(getBytesCurrentEntryStream(obxInputStream));
+        for (DynaBean merge : dynMerges) {
+          merges.put((String) merge.get("MERGED_MODULE_UUID"), (String) merge.get("AD_MODULE_ID"));
+        }
         obxInputStream.closeEntry();
-      foundAll = foundModule && foundDependency && foundPrefix;
+        foundMerge = true;
+      } else {
+        obxInputStream.closeEntry();
+      }
+      foundAll = foundModule && foundDependency && foundPrefix && foundMerge;
     }
     obxInputStream.close();
   }
@@ -1333,6 +1506,12 @@
                   + modulesToUpdate[i].getVersionNo(), "U");
         }
       }
+
+      for (Module merge : modulesToMerge) {
+        ImportModuleData.insertLog(pool, user, merge.getModuleID(), merge.getModuleVersionID(),
+            merge.getName(), "Uninstalled module " + merge.getName() + " because of merge.", "D");
+      }
+
     } catch (final ServletException e) {
       log4j.error("Error inserting log", e);
     }
--- a/src/org/openbravo/erpCommon/modules/VersionUtility.java	Thu Nov 11 16:32:10 2010 +0100
+++ b/src/org/openbravo/erpCommon/modules/VersionUtility.java	Thu Nov 11 18:11:49 2010 +0100
@@ -19,8 +19,10 @@
 
 package org.openbravo.erpCommon.modules;
 
+import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Vector;
 
 import javax.servlet.ServletContext;
@@ -32,9 +34,11 @@
 import org.apache.log4j.Logger;
 import org.openbravo.base.ConnectionProviderContextListener;
 import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.service.OBDal;
 import org.openbravo.database.ConnectionProvider;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.model.ad.module.ModuleMerge;
 import org.openbravo.services.webservice.Module;
 import org.openbravo.services.webservice.ModuleDependency;
 import org.openbravo.services.webservice.ModuleInstallDetail;
@@ -156,8 +160,8 @@
   }
 
   static private boolean checkDependency(String strModVersion, HashMap<String, Mod> modulesMap,
-      HashMap<String, Mod> modsToInstall, HashMap<String, Mod> modsToUpdate, Dep dependency,
-      Vector<String> errors, Vector<String> newModules) throws Exception {
+      HashMap<String, Mod> modsToInstall, HashMap<String, Mod> modsToUpdate,
+      Module[] modulesToMerge, Dep dependency, Vector<String> errors) throws Exception {
     boolean foundModule = false;
 
     Mod mod = null;
@@ -175,11 +179,24 @@
     if (foundModule && checkVersion(strModVersion, dependency, mod, errors)) {
       return true;
     }
-
-    if (modulesMap.get(dependency.modId) == null) {
-      // Appending not installed error message when module is not present
-      errors.add(strModVersion + " @CR_DependensOnModule@ \"" + dependency.modName
-          + "\", @CR_ModuleNotInstalled@");
+    if (!foundModule) {
+      // Module is not found, check whether it is merged
+      boolean merged = false;
+      if (modulesToMerge != null) {
+        for (Module merge : modulesToMerge) {
+          if (dependency.modId.equals(merge.getModuleID())) {
+            merged = true;
+            errors.add(merge.getName() + " @CR_IsMergedBy@ "
+                + merge.getAdditionalInfo().get("mergedWith") + " @CR_MergeCannotUninstall@ "
+                + strModVersion);
+          }
+        }
+      }
+      if (!merged && modulesMap.get(dependency.modId) == null) {
+        // Appending not installed error message when module is not present
+        errors.add(strModVersion + " @CR_DependensOnModule@ \"" + dependency.modName
+            + "\", @CR_ModuleNotInstalled@");
+      }
     }
 
     return false;
@@ -187,11 +204,12 @@
 
   static private boolean checkVersionDependency(String strModVersion,
       HashMap<String, Mod> modulesMap, HashMap<String, Mod> modsToInstall,
-      HashMap<String, Mod> modsToUpdate, Ver version, Vector<String> errors,
-      Vector<String> newModules) throws Exception {
+      HashMap<String, Mod> modsToUpdate, Module[] modulesToMerge, Ver version, Vector<String> errors)
+      throws Exception {
     boolean checked = true;
     HashMap<String, Dep> depMap = version.dependencies;
     depMap.putAll(version.includes);
+
     /** Navigate through dependencies and includes of the module version */
     for (String depKey : depMap.keySet()) {
       /**
@@ -200,8 +218,8 @@
        * new modules or new updates are needed, they are added to they correspondent list and added
        * to errors vector. and the checked is run again with the new configuration
        */
-      if (!checkDependency(strModVersion, modulesMap, modsToInstall, modsToUpdate, depMap
-          .get(depKey), errors, newModules)) {
+      if (!checkDependency(strModVersion, modulesMap, modsToInstall, modsToUpdate, modulesToMerge,
+          depMap.get(depKey), errors)) {
         // If any dependency or include need a new module, it is added
         // to modsToInstall or if needed an update is added to
         // modsToUpdate
@@ -212,8 +230,8 @@
   }
 
   static private boolean checkAllDependencies(HashMap<String, Mod> modulesMap,
-      HashMap<String, Mod> modsToInstall, HashMap<String, Mod> modsToUpdate, Vector<String> errors)
-      throws Exception {
+      HashMap<String, Mod> modsToInstall, HashMap<String, Mod> modsToUpdate,
+      Module[] modulesToMerge, Vector<String> errors) throws Exception {
     // New hashmap of installed modules less the modules that will be
     // updated
     HashMap<String, Mod> modulesInstalledLessToUpdate = new HashMap<String, Mod>();
@@ -227,7 +245,6 @@
     modsForCheckDependencies.putAll(modulesInstalledLessToUpdate);
     modsForCheckDependencies.putAll(modsToInstall);
     modsForCheckDependencies.putAll(modsToUpdate);
-    Vector<String> newModules = new Vector<String>();
     Vector<String> modKey = new Vector<String>(modsForCheckDependencies.keySet());
     /** Navigate through modules */
     for (int i = 0; i < modKey.size(); i++) {
@@ -238,23 +255,37 @@
         Ver ver = verMap.get(verKey);
         String strModVersion = mod.name + "-" + ver.version;
         if (!checkVersionDependency(strModVersion, modulesInstalledLessToUpdate, modsToInstall,
-            modsToUpdate, ver, errors, newModules)) {
+            modsToUpdate, modulesToMerge, ver, errors)) {
           /**
            * When any dependency fails, the process continue to found all dependency errors, but the
            * configuration is marked as no valid
            */
-          if (newModules.size() == 0)
-            checked = false;
+          checked = false;
         }
       }
-      if (newModules.size() > 0) {
-        modKey.addAll(newModules);
-        modsForCheckDependencies.putAll(modsToInstall);
-        modsForCheckDependencies.putAll(modsToUpdate);
-        newModules.removeAllElements();
-        i = 0;
+    }
+
+    // Check modules to install are not merged
+    if (modsToInstall != null) {
+      List<String> modsIdMerged = new ArrayList<String>();
+      if (modulesToMerge != null) {
+        for (Module merge : modulesToMerge) {
+          modsIdMerged.add(merge.getModuleID());
+        }
       }
+      for (ModuleMerge merge : OBDal.getInstance().createCriteria(ModuleMerge.class).list()) {
+        modsIdMerged.add(merge.getMergedModuleUUID());
+      }
+
+      for (Mod module : modsToInstall.values()) {
+        if (modsIdMerged.contains(module.modId)) {
+          errors.add(module.name + " @CannotInstallMerged@");
+          checked = false;
+        }
+      }
+
     }
+
     return checked;
   }
 
@@ -287,24 +318,41 @@
     return modNames.toString();
   }
 
-  static private HashMap<String, Mod> fillModules() throws ServletException {
-    /**
-     * fill Mod objects (include its versions and dependencies from versions) from database for all
-     * Modules IDs
-     */
+  /**
+   * fill Mod objects (include its versions and dependencies from versions) from database for all
+   * Modules IDs excluding the ones to be merged
+   */
+  static private HashMap<String, Mod> fillModules(Module[] modulesToMerge) throws ServletException {
     VersionUtilityData[] data = VersionUtilityData.readModules(pool);
     HashMap<String, Mod> modules = new HashMap<String, Mod>();
     for (int i = 0; i < data.length; i++) {
-      Mod mod = new Mod();
-      mod.modId = data[i].adModuleId;
-      mod.name = data[i].name;
-      mod.type = data[i].type;
-      mod.versions = fillVersions(data[i], mod);
-      modules.put(data[i].adModuleId, mod);
+      if (!isInList(data[i].adModuleId, modulesToMerge)) {
+        Mod mod = new Mod();
+        mod.modId = data[i].adModuleId;
+        mod.name = data[i].name;
+        mod.type = data[i].type;
+        mod.versions = fillVersions(data[i], mod);
+        modules.put(data[i].adModuleId, mod);
+      }
     }
     return modules;
   }
 
+  /**
+   * Checks whether a module id is in a list of modules
+   */
+  private static boolean isInList(String moduleId, Module[] modules) {
+    if (modules == null) {
+      return false;
+    }
+    for (Module mod : modules) {
+      if (moduleId.equals(mod.getModuleID())) {
+        return true;
+      }
+    }
+    return false;
+  }
+
   static private HashMap<String, Ver> fillVersions(VersionUtilityData data, Mod mod)
       throws ServletException {
     /** fill Ver objects from database */
@@ -316,8 +364,8 @@
     if (data != null) {
       Ver ver = new Ver();
       ver.version = data.version;
-      ver.dependencies = fillDependencies(ver.verId);
-      ver.includes = fillIncludes(ver.verId);
+      ver.dependencies = fillDependencies(mod.modId);
+      ver.includes = fillIncludes(mod.modId);
       hashVer.put(ver.version, ver);
 
       /** in the local database there is only one version by module */
@@ -367,6 +415,18 @@
       dep.maxVer = data[i].endversion;
       dep.modId = data[i].adDependentModuleId;
       dep.modName = data[i].dependantModuleName;
+
+      // set enforcement
+      if ("Y".equals(data[i].userEditableEnforcement) && data[i].instanceEnforcement != null
+          && !data[i].instanceEnforcement.isEmpty()) {
+        dep.enforcement = data[i].instanceEnforcement;
+      } else {
+        dep.enforcement = data[i].dependencyEnforcement;
+        if (dep.enforcement == null || dep.enforcement.isEmpty()) {
+          dep.enforcement = "MAJOR";
+        }
+      }
+
       hashDep.put(data[i].adModuleDependencyId, dep);
     }
     return hashDep;
@@ -533,15 +593,16 @@
   }
 
   static private boolean installModulesLocal(Module[] modulesToInstall, Module[] modulesToUpdate,
-      Vector<String> vecErrors) throws Exception {
+      Module[] modulesToMerge, Vector<String> vecErrors) throws Exception {
     boolean checked = false;
-    HashMap<String, Mod> modsInstalled = fillModules();
+    HashMap<String, Mod> modsInstalled = fillModules(modulesToMerge);
     HashMap<String, Mod> modsToInstall = modules2mods(modulesToInstall);
     HashMap<String, Mod> modsToUpdate = modules2mods(modulesToUpdate);
 
     try {
       /** Check if all dependencies are satisfied with installed modules */
-      checked = checkAllDependencies(modsInstalled, modsToInstall, modsToUpdate, vecErrors);
+      checked = checkAllDependencies(modsInstalled, modsToInstall, modsToUpdate, modulesToMerge,
+          vecErrors);
     } catch (Exception e) {
       throw e;
     }
@@ -621,31 +682,41 @@
    *          In param. New modules to install, with its dependencies.
    * @param modulesToUpdate
    *          In param. Modules to install, with its dependencies.
+   * @param modulesToMerge
+   *          In param. Modules to merge.
    * @param obErrors
    *          Out param. Errors in dependencies. Null if no errors.
    * @return true if all dependencies can be resolved without need of download any package from
    *         central repository, false in other case.
    */
   static public boolean checkLocal(VariablesSecureApp vars, Module[] modulesToInstall,
-      Module[] modulesToUpdate, OBError obErrors) throws Exception {
+      Module[] modulesToUpdate, Module[] modulesToMerge, OBError obErrors) throws Exception {
     Vector<String> vecErrors = new Vector<String>();
 
-    boolean checked = installModulesLocal(modulesToInstall, modulesToUpdate, vecErrors);
+    boolean checked = installModulesLocal(modulesToInstall, modulesToUpdate, modulesToMerge,
+        vecErrors);
 
     String[] errors = vecErrors.toArray(new String[0]);
     getOBError(obErrors, pool, vars, errors);
     return checked;
-
   }
 
   /**
-   * @deprecated used
-   *             {@link VersionUtility#checkLocal(VariablesSecureApp, Module[], Module[], OBError)}
+   * @deprecated use
+   *             {@link VersionUtility#checkLocal(VariablesSecureApp, Module[], Module[], Module[], OBError)}
+   */
+  static public boolean checkLocal(VariablesSecureApp vars, Module[] modulesToInstall,
+      Module[] modulesToUpdate, OBError obErrors) throws Exception {
+    return checkLocal(vars, modulesToInstall, null, null, obErrors);
+  }
+
+  /**
+   * @deprecated use
+   *             {@link VersionUtility#checkLocal(VariablesSecureApp, Module[], Module[], Module[], OBError)}
    */
   static public boolean checkLocal(VariablesSecureApp vars, Module[] modulesToInstall,
       OBError obErrors) throws Exception {
-    return checkLocal(vars, modulesToInstall, null, obErrors);
-
+    return checkLocal(vars, modulesToInstall, null, null, obErrors);
   }
 
   static public void setPool(ConnectionProvider cp) {