From 502192986b27901687ff5009bbe28f21904be9e9 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 19 Mar 2013 17:23:09 +0800 Subject: [PATCH] IDEMPIERE-761 New record on role is showing role 0 info on detail. --- .../src/org/compiere/model/GridTab.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/GridTab.java b/org.adempiere.base/src/org/compiere/model/GridTab.java index 039f66e344..0340551bf8 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTab.java +++ b/org.adempiere.base/src/org/compiere/model/GridTab.java @@ -747,6 +747,26 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable setCurrentRow(0, true); } // query + public void clearForNewParentRecord() { + if (m_mTable.isOpen()) + { + StringBuffer where = new StringBuffer("2=3"); + m_extendedWhere = where.toString(); + m_oldQuery = where.toString(); + m_parentNeedSave = true; + + m_currentRow = -1; + /** + * Query + */ + if (log.isLoggable(Level.FINE)) log.fine("#" + m_vo.TabNo + " - " + where); + m_mTable.dataRequery(where.toString(), m_vo.onlyCurrentRows && !isDetail(), 0); + + // Go to Record 0 + setCurrentRow(0, true); + } + } + /** * Validate Query. * If query column is not a tab column create EXISTS query