Fix [2790959] Document Date not updating Period as it did in Compiere (commit 1 of 2)

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2790959
This commit is contained in:
Carlos Ruiz 2010-04-27 03:58:10 +00:00
parent 2d3d18d0f9
commit f49ae0553d
2 changed files with 24 additions and 1 deletions

View File

@ -200,6 +200,29 @@ public class CalloutEngine implements Callout
return m_mTab != null ? m_mTab.getActiveCallouts().length > 1 : false;
} // isCalloutActive
/**
* Is the current callout being called in the middle of
* another callout doing her works.
* Callout can use GridTab.getActiveCalloutInstance() method
* to find out callout for which field is running.
* @return true if active
*/
protected boolean isThisCalloutActive()
{
if (m_mTab == null)
return false;
//greater than 1 instead of 0 to discount this callout instance
String className = this.getClass().getName();
String methodName = Thread.currentThread().getStackTrace()[2].getMethodName();
String calloutName = className + "." + methodName;
int cnt = 0;
for (String activeCallouts : m_mTab.getActiveCallouts()) {
if (activeCallouts.equals(calloutName))
cnt++;
}
return cnt > 1;
} // isCalloutActive
/**
* Set Callout (in)active.
* Depreciated as the implementation is not thread safe and

View File

@ -49,7 +49,7 @@ public class CalloutGLJournal extends CalloutEngine
public String period (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{
String colName = mField.getColumnName();
if (value == null || isCalloutActive())
if (value == null || isThisCalloutActive())
return "";
int AD_Client_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Client_ID");