Fixed issue 8564
authorAntonio Moreno <antonio.moreno@openbravo.com>
Tue, 14 Apr 2009 15:17:50 +0200
changeset 4188 bd1ef78ba236
parent 4186 baa73777edba
child 4189 f121c0cb660b
Fixed issue 8564
src-db/database/build.xml
src/org/openbravo/erpCommon/modules/ImportModule.java
src/org/openbravo/erpCommon/modules/ImportModule_data.xsql
--- a/src-db/database/build.xml	Tue Apr 14 13:06:49 2009 +0000
+++ b/src-db/database/build.xml	Tue Apr 14 15:17:50 2009 +0200
@@ -131,6 +131,7 @@
   <target name="update.database.mod">
     <alterdatabasedatamod driver="${bbdd.driver}" url="${bbdd.owner.url}" user="${bbdd.user}" password="${bbdd.password}" excludeobjects="com.openbravo.db.OpenbravoExcludeFilter" model="model" filter="com.openbravo.db.OpenbravoMetadataFilter" input="sourcedata" object="${bbdd.object}" failonerror="false" verbosity="DEBUG" basedir="${base.modules}/" baseConfig="${base.config}" dirFilter="*/src-db/database/model" datadir="${base.modules}/" dataFilter="*/src-db/database/sourcedata" module="${module}" userId="0" propertiesFile="${base.config}/Openbravo.properties" force="${force}" />
     <antcall target="database.postupdate.${bbdd.rdbms}" />
+    <antcall target="update.dbupdate.timestamp" />
   </target>
   <target name="clean.database.ORACLE">
     <sql driver="${bbdd.driver}" url="${bbdd.url}" userid="${bbdd.systemUser}" password="${bbdd.systemPassword}" onerror="continue">
@@ -441,3 +442,4 @@
     </sql>
   </target>
 </project>
+
--- a/src/org/openbravo/erpCommon/modules/ImportModule.java	Tue Apr 14 13:06:49 2009 +0000
+++ b/src/org/openbravo/erpCommon/modules/ImportModule.java	Tue Apr 14 15:17:50 2009 +0200
@@ -788,6 +788,12 @@
     for (final DynaBean module : dbPrefix) {
       platform.updateinsert(conn, db, module);
     }
+    for (final DynaBean module : dModulesToInstall) {
+      String modID = (String) module.get("AD_MODULE_ID");
+      ImportModuleData.updateModuleDate(pool, modID);
+      ImportModuleData.updateModulePrefixDate(pool, modID);
+      ImportModuleData.updateModuleDependencyDate(pool, modID);
+    }
     conn.close();
   }
 
@@ -1130,3 +1136,4 @@
     }
   }
 }
+
--- a/src/org/openbravo/erpCommon/modules/ImportModule_data.xsql	Tue Apr 14 13:06:49 2009 +0000
+++ b/src/org/openbravo/erpCommon/modules/ImportModule_data.xsql	Tue Apr 14 15:17:50 2009 +0200
@@ -149,6 +149,40 @@
       <Parameter name="moduleId"/>
    </SqlMethod>
    
+   <SqlMethod name="updateModuleDate" type="preparedStatement" return="rowcount">
+      <SqlMethodComment></SqlMethodComment>
+      <Sql>
+        UPDATE AD_MODULE
+           SET UPDATED = (SELECT LAST_DBUPDATE FROM AD_SYSTEM_INFO)
+         WHERE AD_MODULE_ID = ?
+           AND UPDATED > (SELECT LAST_DBUPDATE FROM AD_SYSTEM_INFO)
+      </Sql>
+      <Parameter name="moduleId"/>
+   </SqlMethod>
+   
+   <SqlMethod name="updateModulePrefixDate" type="preparedStatement" return="rowcount">
+      <SqlMethodComment></SqlMethodComment>
+      <Sql>
+        UPDATE AD_MODULE_DBPREFIX
+           SET UPDATED = (SELECT LAST_DBUPDATE FROM AD_SYSTEM_INFO)
+         WHERE AD_MODULE_ID = ?
+         AND UPDATED > (SELECT LAST_DBUPDATE FROM AD_SYSTEM_INFO)
+      </Sql>
+      <Parameter name="moduleId"/>
+   </SqlMethod>
+   
+    <SqlMethod name="updateModuleDependencyDate" type="preparedStatement" return="rowcount">
+      <SqlMethodComment></SqlMethodComment>
+      <Sql>
+        UPDATE AD_MODULE_DEPENDENCY
+           SET UPDATED = (SELECT LAST_DBUPDATE FROM AD_SYSTEM_INFO)
+         WHERE AD_MODULE_ID = ?
+         AND UPDATED > (SELECT LAST_DBUPDATE FROM AD_SYSTEM_INFO)
+      </Sql>
+      <Parameter name="moduleId"/>
+   </SqlMethod>
+   
+   
    <SqlMethod name="getParentNode" type="preparedStatement" return="string">
      <Sql>
        SELECT AD_MODULE_ID
@@ -159,3 +193,4 @@
      <Parameter name="moduleId"/>
    </SqlMethod>
 </SqlClass>
+