[RTL] Merge from pi
authorDavid Baz Fayos <david.baz@openbravo.com>
Mon, 16 Apr 2012 23:06:52 +0200
changeset 16320 6159ea016975
parent 16319 98ca96d22dcd (current diff)
parent 16102 5ac4bd2d23c0 (diff)
child 16321 37d2f806481e
[RTL] Merge from pi
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Mon Apr 16 16:22:46 2012 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js	Mon Apr 16 23:06:52 2012 +0200
@@ -50,8 +50,9 @@
   editLinkFieldProperties: {
     type: 'text',
     canSort: false,
+    canReorder: false,
     frozen: true,
-    canFreeze: true,
+    canFreeze: false,
     canEdit: false,
     canGroupBy: false,
     canHide: false,
--- a/modules/org.openbravo.client.htmlwidget/web/org.openbravo.client.htmlwidget/js/ob-html-widget.js	Mon Apr 16 16:22:46 2012 +0200
+++ b/modules/org.openbravo.client.htmlwidget/web/org.openbravo.client.htmlwidget/js/ob-html-widget.js	Mon Apr 16 23:06:52 2012 +0200
@@ -50,7 +50,7 @@
     if (this.parameters.htmlcode) {
       this.contentSource = this.evaluateContents(this.parameters.htmlcode);
     }
-    this.windowContents.contents = this.contentSource;
+    this.windowContents.setContents(this.contentSource);
   },
 
   setWidgetHeight: function () {
Binary file modules/org.openbravo.v3.datasets/build/classes/org/openbravo/v3/datasets/SetDefaultRole.class has changed
--- a/modules/org.openbravo.v3.datasets/src-util/modulescript/src/org/openbravo/v3/datasets/SetDefaultRole.java	Mon Apr 16 16:22:46 2012 +0200
+++ b/modules/org.openbravo.v3.datasets/src-util/modulescript/src/org/openbravo/v3/datasets/SetDefaultRole.java	Mon Apr 16 23:06:52 2012 +0200
@@ -36,7 +36,7 @@
     try {
       ConnectionProvider cp = getConnectionProvider();
       PreparedStatement ps = cp
-          .getPreparedStatement("update ad_user set default_ad_role_id='FF8080812AFBCB14012AFBD3E4340031' where ad_user_id='100' and default_ad_role_id is NULL and exists (select 1 from ad_role where ad_role_id='FF8080812AFBCB14012AFBD3E4340031')");
+          .getPreparedStatement("update ad_user set default_ad_role_id='42D0EEB1C66F497A90DD526DC597E6F0' where ad_user_id='100' and default_ad_role_id is NULL and exists (select 1 from ad_role where ad_role_id='42D0EEB1C66F497A90DD526DC597E6F0')");
       ps.executeUpdate();
     } catch (Exception e) {
       handleError(e);
--- a/src/org/openbravo/service/system/ModuleValidator.java	Mon Apr 16 16:22:46 2012 +0200
+++ b/src/org/openbravo/service/system/ModuleValidator.java	Mon Apr 16 23:06:52 2012 +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-2012 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -45,6 +45,7 @@
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.ui.TextInterface;
 import org.openbravo.model.ad.ui.Window;
+import org.openbravo.model.ad.utility.DataSet;
 import org.openbravo.service.system.SystemValidationResult.SystemValidationType;
 
 /**
@@ -106,6 +107,8 @@
 
     checkTableName(module, result);
 
+    checkHasReferenceData(module, result);
+
     // disable this check until this issue has been commented:
     // https://issues.openbravo.com/view.php?id=7905
     // checkHasIllegalId(module, result);
@@ -360,6 +363,24 @@
     }
   }
 
+  private void checkHasReferenceData(Module module, SystemValidationResult result) {
+    OBCriteria<DataSet> datasetsCriteria = OBDal.getInstance().createCriteria(DataSet.class);
+    datasetsCriteria.add(Restrictions.eq(DataSet.PROPERTY_MODULE, module));
+    int numDatasets = datasetsCriteria.count();
+
+    if (module.isHasReferenceData() && numDatasets == 0) {
+      result.addWarning(SystemValidationType.MODULE_ERROR, "Module " + module.getName()
+          + " has been marked as 'has reference data' but it does not have any Dataset associated");
+    } else if (!module.isHasReferenceData() && numDatasets > 0) {
+      result
+          .addWarning(
+              SystemValidationType.MODULE_ERROR,
+              "Module "
+                  + module.getName()
+                  + " has at least one Dataset associated but it has not been marked as 'has reference data'");
+    }
+  }
+
   private void checkJavaPackages(Module module, SystemValidationResult result) {
     for (org.openbravo.model.ad.module.DataPackage pckg : module.getDataPackageList()) {
       if (pckg.getJavaPackage() != null