src/org/openbravo/erpCommon/ad_process/ApplyModules_data.xsql
changeset 5074 bdfd1c945653
parent 4271 bc808429aa25
child 5075 c1b84d47d082
--- 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>