From ccc2d90e8c442af2025ea8733efc97262f52fabd Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 22 Jun 2015 12:53:05 -0500 Subject: [PATCH] IDEMPIERE-2676 Incorrect context variables --- .../i2.1/oracle/201506171641_IDEMPIERE-2676.sql | 16 ++++++++++++++++ .../postgresql/201506171641_IDEMPIERE-2676.sql | 12 ++++++++++++ .../src/org/compiere/model/GridTab.java | 6 ++++++ 3 files changed, 34 insertions(+) create mode 100644 migration/i2.1/oracle/201506171641_IDEMPIERE-2676.sql create mode 100644 migration/i2.1/postgresql/201506171641_IDEMPIERE-2676.sql diff --git a/migration/i2.1/oracle/201506171641_IDEMPIERE-2676.sql b/migration/i2.1/oracle/201506171641_IDEMPIERE-2676.sql new file mode 100644 index 0000000000..b7e94c754f --- /dev/null +++ b/migration/i2.1/oracle/201506171641_IDEMPIERE-2676.sql @@ -0,0 +1,16 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2676 Incorrect context variables +-- Jun 17, 2015 4:40:47 PM COT +UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceList', IsUpdateable='N',Updated=TO_DATE('2015-06-17 16:40:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2161 +; + +-- IDEMPIERE-2676 Incorrect context variables +-- Jun 22, 2015 12:50:04 PM COT +UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceList', IsUpdateable='N',Updated=TO_DATE('2015-06-22 12:50:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3484 +; + +SELECT register_migration_script('201506171641_IDEMPIERE-2676.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201506171641_IDEMPIERE-2676.sql b/migration/i2.1/postgresql/201506171641_IDEMPIERE-2676.sql new file mode 100644 index 0000000000..335c28af30 --- /dev/null +++ b/migration/i2.1/postgresql/201506171641_IDEMPIERE-2676.sql @@ -0,0 +1,12 @@ +-- IDEMPIERE-2676 Incorrect context variables +-- Jun 17, 2015 4:40:47 PM COT +UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceList', IsUpdateable='N',Updated=TO_TIMESTAMP('2015-06-17 16:40:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2161 +; + +-- Jun 22, 2015 12:50:04 PM COT +UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceList', IsUpdateable='N',Updated=TO_TIMESTAMP('2015-06-22 12:50:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3484 +; + +SELECT register_migration_script('201506171641_IDEMPIERE-2676.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 07c2a0c33e..4ae74f8c40 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -2542,12 +2542,14 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable */ public int setCurrentRow (int newCurrentRow, boolean fireEvents) { + boolean changingRow = (m_currentRow != newCurrentRow); int oldCurrentRow = m_currentRow; m_currentRow = verifyRow (newCurrentRow); if (log.isLoggable(Level.FINE)) log.fine("Row=" + m_currentRow + " - fire=" + fireEvents); // Update Field Values int size = m_mTable.getColumnCount(); + GridField keyCalloutDelayed = null; for (int i = 0; i < size; i++) { GridField mField = m_mTable.getField(i); @@ -2558,6 +2560,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable mField.setValue(value, m_mTable.isInserting()); if (m_mTable.isInserting()) // set invalid values to null mField.validateValue(); + if (mField.isKey()) + keyCalloutDelayed = mField; } else { // no rows - set to a reasonable value - not updateable @@ -2576,6 +2580,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable mField.setValue(); } } + if (changingRow && keyCalloutDelayed != null) + processCallout(keyCalloutDelayed); loadDependentInfo(); if (!fireEvents) // prevents informing twice