IDEMPIERE-1168 Master-detail issue with context variables (problem paying multiple invoices). Implement ~ prefix for current tab variable.

This commit is contained in:
Heng Sin Low 2013-07-22 16:02:37 +08:00
parent 2aebb1b5ea
commit 0f04122f5b
2 changed files with 15 additions and 1 deletions

View File

@ -884,7 +884,15 @@ public class GridField
if( m_vo.TabNo == 0)
return Env.getContext (ctx, m_vo.WindowNo, variableName, true);
else
return Env.getContext (ctx, m_vo.WindowNo, m_vo.TabNo, variableName, false, true);
{
boolean tabOnly = false;
if (variableName.startsWith("~"))
{
variableName = variableName.substring(1);
tabOnly = true;
}
return Env.getContext (ctx, m_vo.WindowNo, m_vo.TabNo, variableName, tabOnly, true);
}
} // get_ValueAsString

View File

@ -171,6 +171,10 @@ public class Evaluator
firstEval = defaultValue;
}
}
//NPE sanity check
if (firstEval == null)
firstEval = "";
firstEval = firstEval.replace('\'', ' ').replace('"', ' ').trim(); // strip ' and "
// Comperator
@ -283,6 +287,8 @@ public class Evaluator
String variable = s.substring(0, pos);
s = s.substring(pos+1);
// log.fine( variable);
if (variable.startsWith("~"))
variable = variable.substring(1);
list.add(variable);
}
} // parseDepends