fixed bug 24514: Delete Client fails when the AD has Datasource based tables
authorAsier Lostalé <asier.lostale@openbravo.com>
Thu, 08 Aug 2013 14:44:30 +0200
changeset 20833 2e5b9ae92ea2
parent 20832 37aeae33b0c0
child 20834 3ca2970a5892
fixed bug 24514: Delete Client fails when the AD has Datasource based tables

Do not include these tabase in delete sql statements
src/org/openbravo/service/system/SystemService.java
--- a/src/org/openbravo/service/system/SystemService.java	Thu Aug 01 17:32:27 2013 +0200
+++ b/src/org/openbravo/service/system/SystemService.java	Thu Aug 08 14:44:30 2013 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2009-2011 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2013 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -321,7 +321,8 @@
 
       List<Entity> entities = ModelProvider.getInstance().getModel();
       for (Entity entity : entities) {
-        if ((entity.isClientEnabled() || entity.getName().equals("ADClient")) && !entity.isView()) {
+        if ((entity.isClientEnabled() || entity.getName().equals("ADClient")) && !entity.isView()
+            && !entity.isDataSourceBased()) {
           final String sql = "delete from " + entity.getTableName() + " where ad_client_id=?";
           sqlCommands.add(sql);
         }