Fixed issue 10128. When applying industry templates, a full compile.complete will be done to make sure all modified windows are updated.
authorAntonio Moreno <antonio.moreno@openbravo.com>
Wed, 23 Sep 2009 13:06:51 +0200
changeset 5074 bdfd1c945653
parent 5073 908a09f23ff5
child 5075 c1b84d47d082
Fixed issue 10128. When applying industry templates, a full compile.complete will be done to make sure all modified windows are updated.
src/org/openbravo/erpCommon/ad_process/ApplyModules.java
src/org/openbravo/erpCommon/ad_process/ApplyModules_data.xsql
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Wed Sep 23 12:19:29 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules.java	Wed Sep 23 13:06:51 2009 +0200
@@ -209,7 +209,7 @@
 
       final String unnappliedModules = getUnnapliedModules();
 
-      if (ApplyModulesData.isUpdatingCore(this)) {
+      if (ApplyModulesData.isUpdatingCoreOrTemplate(this)) {
         tasks.add("update.database");
         tasks.add("core.lib");
         tasks.add("wad.lib");
--- a/src/org/openbravo/erpCommon/ad_process/ApplyModules_data.xsql	Wed Sep 23 12:19:29 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ApplyModules_data.xsql	Wed Sep 23 13:06:51 2009 +0200
@@ -37,13 +37,19 @@
       </Sql>
   </SqlMethod>
   
-  <SqlMethod name="isUpdatingCore" type="preparedStatement" return="boolean">
+  <SqlMethod name="isUpdatingCoreOrTemplate" type="preparedStatement" return="boolean">
       <SqlMethodComment></SqlMethodComment>
       <Sql><![CDATA[
-         SELECT count(*) as NAME
-           FROM AD_MODULE
-          WHERE STATUS='I'      
-            AND AD_MODULE_ID = '0'
+         SELECT count(*) as NAME FROM
+            ((SELECT 1  
+                FROM AD_MODULE
+                WHERE STATUS='I'      
+               AND (AD_MODULE_ID = '0' OR TYPE='T'))
+            UNION
+            (SELECT 1
+                FROM AD_MODULE_INSTALL
+                WHERE STATUS='I'      
+               AND (AD_MODULE_ID = '0' OR TYPE='T'))) as q
           ]]>
       </Sql>
   </SqlMethod>