From 0165e4d54058b6ac243d4d592331805b74e896ff Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 1 May 2008 05:41:20 +0000 Subject: [PATCH] Fix [ 1955264 ] Changing columns is updating fields needlessly --- base/src/org/compiere/model/MColumn.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/base/src/org/compiere/model/MColumn.java b/base/src/org/compiere/model/MColumn.java index 3facea2d7f..8fc9e69cf5 100644 --- a/base/src/org/compiere/model/MColumn.java +++ b/base/src/org/compiere/model/MColumn.java @@ -256,14 +256,19 @@ public class MColumn extends X_AD_Column // Update Fields if (!newRecord) { - StringBuffer sql = new StringBuffer("UPDATE AD_Field SET Name=") - .append(DB.TO_STRING(getName())) - .append(", Description=").append(DB.TO_STRING(getDescription())) - .append(", Help=").append(DB.TO_STRING(getHelp())) - .append(" WHERE AD_Column_ID=").append(get_ID()) - .append(" AND IsCentrallyMaintained='Y'"); - int no = DB.executeUpdate(sql.toString(), get_TrxName()); - log.fine("afterSave - Fields updated #" + no); + if ( is_ValueChanged(MColumn.COLUMNNAME_Name) + || is_ValueChanged(MColumn.COLUMNNAME_Description) + || is_ValueChanged(MColumn.COLUMNNAME_Help) + ) { + StringBuffer sql = new StringBuffer("UPDATE AD_Field SET Name=") + .append(DB.TO_STRING(getName())) + .append(", Description=").append(DB.TO_STRING(getDescription())) + .append(", Help=").append(DB.TO_STRING(getHelp())) + .append(" WHERE AD_Column_ID=").append(get_ID()) + .append(" AND IsCentrallyMaintained='Y'"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); + log.fine("afterSave - Fields updated #" + no); + } } return success; } // afterSave