details: /erp/devel/pi/rev/672521a0fa19
changeset: 12001:672521a0fa19
user: Antonio Moreno <antonio.moreno <at> openbravo.com>
date: Thu May 05 12:18:18 2011 +0200
summary: Fixed issue 16935. Sourcedata files not ending in .xml will not be
loaded
details: /erp/devel/pi/rev/e39becf937bd
changeset: 12002:e39becf937bd
user: Antonio Moreno <antonio.moreno <at> openbravo.com>
date: Thu May 05 17:39:06 2011 +0200
summary: Fixed issue 16655. On CHANGE mode, the FIC will not compute all the
fields.
This change basically involves making the FIC not compute every field on CHANGE
mode, but only the ones which really are needed. What is done is basically to
compute the every column which directly or indirectly depends on the
changedColumn.
The reason this is needed is that if all the combos are computed, then
non-legal values ('*' values) in combos which are not related to the one the
user change will be changed to the first valid value (as the combo will be
recomputed).
In addition to this a change in ob-view-form was needed to prevent a
race-condition like error in the UI, which happened because this change has
incidentally made the FIC computation much faster in windows with a big number
of combos.
details: /erp/devel/pi/rev/0a13fecd1e93
changeset: 12003:0a13fecd1e93
user: Antonio Moreno <antonio.moreno <at> openbravo.com>
date: Thu May 05 17:49:38 2011 +0200
summary: Fixed issue 17023. Do not call fillAttachments on grid mode, so that
grid editing works again
diffstat:
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
| 124 ++++++---
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
| 12 +-
src-db/database/lib/dbsourcemanager.jar
| 0
3 files changed, 90 insertions(+), 46 deletions(-)
diffs (200 lines):
diff -r 4c9f6a68419e -r 0a13fecd1e93
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
---
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
Thu May 05 17:13:53 2011 +0200
+++
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
Thu May 05 17:49:38 2011 +0200
@@ -190,8 +190,8 @@
// Calculation of validation dependencies
long t3 = System.currentTimeMillis();
- computeListOfColumnsSortedByValidationDependencies(tab, allColumns,
columnsInValidation,
- changeEventCols);
+ computeListOfColumnsSortedByValidationDependencies(mode, tab, allColumns,
+ columnsInValidation, changeEventCols, changedColumn);
// Computation of the Auxiliary Input values
long t4 = System.currentTimeMillis();
@@ -672,9 +672,9 @@
return referencedEntity.equals(parentEntity);
}
- private void computeListOfColumnsSortedByValidationDependencies(Tab tab,
+ private void computeListOfColumnsSortedByValidationDependencies(String mode,
Tab tab,
List<String> sortedColumns, Map<String, List<String>>
columnsInValidation,
- List<String> changeEventCols) {
+ List<String> changeEventCols, String changedColumn) {
List<Field> fields = tab.getADFieldList();
ArrayList<String> columns = new ArrayList<String>();
List<String> columnsWithValidation = new ArrayList<String>();
@@ -699,52 +699,73 @@
log.debug("Columns in validation: '" + cols + "'");
}
- // Add client and org first to compute dependencies correctly
- for (Field field : fields) {
- String colName = field.getColumn().getDBColumnName();
- if (colName.equalsIgnoreCase("Ad_Client_Id")) {
- sortedColumns.add(colName);
+ if (mode.equals("CHANGE")) {
+ // In case of a CHANGE event, we only add the changed column, to avoid
firing reloads for
+ // every column in the tab, instead firing reloads just for the
dependant columns
+ String changedCol = "";
+ for (Field field : fields) {
+ String colName = field.getColumn().getDBColumnName();
+ if (changedColumn.equalsIgnoreCase("inp" +
Sqlc.TransformaNombreColumna(colName))) {
+ sortedColumns.add(colName);
+ changedCol = colName;
+ }
+ }
+ String depColumn = pickDependantColumn(sortedColumns,
columnsWithValidation,
+ columnsInValidation);
+ while (depColumn != null) {
+ sortedColumns.add(depColumn);
+ depColumn = pickDependantColumn(sortedColumns, columnsWithValidation,
columnsInValidation);
+ }
+ sortedColumns.remove(changedCol);
+ } else {
+ // Add client and org first to compute dependencies correctly
+ for (Field field : fields) {
+ String colName = field.getColumn().getDBColumnName();
+ if (colName.equalsIgnoreCase("Ad_Client_Id")) {
+ sortedColumns.add(colName);
+ }
+ }
+ for (Field field : fields) {
+ String colName = field.getColumn().getDBColumnName();
+ if (colName.equalsIgnoreCase("Ad_Org_Id")) {
+ sortedColumns.add(colName);
+ }
+ }
+ // we add the columns not included in the sortedColumns
+ // (the ones which don't have validations)
+ for (Field field : fields) {
+ String colName = field.getColumn().getDBColumnName();
+ if
(!columnsWithValidation.contains(field.getColumn().getDBColumnName())
+ && !sortedColumns.contains(colName) &&
!colName.equalsIgnoreCase("documentno")) {
+ sortedColumns.add(colName);
+ }
+ }
+ String nonDepColumn = pickNonDependantColumn(sortedColumns,
columnsWithValidation,
+ columnsInValidation);
+ while (nonDepColumn != null) {
+ sortedColumns.add(nonDepColumn);
+ nonDepColumn = pickNonDependantColumn(sortedColumns,
columnsWithValidation,
+ columnsInValidation);
}
}
- for (Field field : fields) {
- String colName = field.getColumn().getDBColumnName();
- if (colName.equalsIgnoreCase("Ad_Org_Id")) {
- sortedColumns.add(colName);
+ if (!mode.equalsIgnoreCase("CHANGE")) {
+ for (Field field : fields) {
+ String colName = field.getColumn().getDBColumnName();
+ if (colName.equalsIgnoreCase("documentno")) {
+ sortedColumns.add(colName);
+ }
}
- }
- // we add the columns not included in the sortedColumns
- // (the ones which don't have validations)
- for (Field field : fields) {
- String colName = field.getColumn().getDBColumnName();
- if (!columnsWithValidation.contains(field.getColumn().getDBColumnName())
- && !sortedColumns.contains(colName) &&
!colName.equalsIgnoreCase("documentno")) {
- sortedColumns.add(colName);
+ String cycleCols = "";
+ for (String col : columnsWithValidation) {
+ if (!sortedColumns.contains(col)) {
+ cycleCols += "," + col;
+ }
}
- }
- String nonDepColumn = pickNonDependantColumn(sortedColumns,
columnsWithValidation,
- columnsInValidation);
- while (nonDepColumn != null) {
- sortedColumns.add(nonDepColumn);
- nonDepColumn = pickNonDependantColumn(sortedColumns,
columnsWithValidation,
- columnsInValidation);
- }
-
- for (Field field : fields) {
- String colName = field.getColumn().getDBColumnName();
- if (colName.equalsIgnoreCase("documentno")) {
- sortedColumns.add(colName);
+ if (!cycleCols.equals("")) {
+ throw new OBException("Error. The columns " + cycleCols.substring(1)
+ + " have validations which form a cycle.");
}
}
- String cycleCols = "";
- for (String col : columnsWithValidation) {
- if (!sortedColumns.contains(col)) {
- cycleCols += "," + col;
- }
- }
- if (!cycleCols.equals("")) {
- throw new OBException("Error. The columns " + cycleCols.substring(1)
- + " have validations which form a cycle.");
- }
String finalCols = "";
for (String col : sortedColumns) {
finalCols += col + ",";
@@ -1144,6 +1165,21 @@
return null;
}
+ private String pickDependantColumn(List<String> sortedColumns, List<String>
columns,
+ Map<String, List<String>> columnsInValidation) {
+ for (String col : columns) {
+ if (sortedColumns.contains(col)) {
+ continue;
+ }
+ for (String depCol : columnsInValidation.get(col)) {
+ if (containsIgnoreCase(sortedColumns, depCol))
+ return col;
+ }
+ }
+
+ return null;
+ }
+
private String pickNonDependantColumn(List<String> sortedColumns,
List<String> columns,
Map<String, List<String>> columnsInValidation) {
for (String col : columns) {
diff -r 4c9f6a68419e -r 0a13fecd1e93
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
Thu May 05 17:13:53 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-form.js
Thu May 05 17:49:38 2011 +0200
@@ -538,7 +538,9 @@
}
}
- this.attachmentsSection.fillAttachments(data.attachments);
+ if(this.attachmentsSection) {
+ this.attachmentsSection.fillAttachments(data.attachments);
+ }
// apparently sometimes an empty string is returned
if (calloutMessages && calloutMessages.length > 0 && calloutMessages[0]
!== '') {
@@ -881,6 +883,12 @@
item._hasChanged = false;
},
+ setDisabledWhenStillInFIC: function() {
+ if (this.inFicCall) {
+ this.setDisabled(true);
+ }
+ },
+
// note item can be null, is also called when the form is re-shown
// to recompute combos
doChangeFICCall: function(item){
@@ -905,7 +913,7 @@
// before disabling
// only do this if there is no popup currently
if (!this.view.standardWindow.inAutoSaveConfirmation) {
- this.delayCall('setDisabled', [true], 10);
+ this.delayCall('setDisabledWhenStillInFIC', [true], 10);
}
var editRow = this.view.viewGrid.getEditRow();
diff -r 4c9f6a68419e -r 0a13fecd1e93 src-db/database/lib/dbsourcemanager.jar
Binary file src-db/database/lib/dbsourcemanager.jar has changed
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits