IDEMPIERE-1172 Setup Wizard uses randomly languages / found the issue is because of adding object to cache on constructor (found and cleared same issue on MRfQLine and MRfQLineQty)
This commit is contained in:
parent
6ade4c42ca
commit
2ab9b1554a
|
@ -85,8 +85,6 @@ public class MRfQLine extends X_C_RfQLine
|
||||||
public MRfQLine (Properties ctx, ResultSet rs, String trxName)
|
public MRfQLine (Properties ctx, ResultSet rs, String trxName)
|
||||||
{
|
{
|
||||||
super(ctx, rs, trxName);
|
super(ctx, rs, trxName);
|
||||||
if (get_ID() > 0)
|
|
||||||
s_cache.put(new Integer(get_ID()), this);
|
|
||||||
} // MRfQLine
|
} // MRfQLine
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -89,8 +89,6 @@ public class MRfQLineQty extends X_C_RfQLineQty
|
||||||
public MRfQLineQty (Properties ctx, ResultSet rs, String trxName)
|
public MRfQLineQty (Properties ctx, ResultSet rs, String trxName)
|
||||||
{
|
{
|
||||||
super(ctx, rs, trxName);
|
super(ctx, rs, trxName);
|
||||||
if (get_ID() > 0)
|
|
||||||
s_cache.put (new Integer (get_ID()), this);
|
|
||||||
} // MRfQLineQty
|
} // MRfQLineQty
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -27,6 +27,7 @@ import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.adempiere.exceptions.AdempiereException;
|
||||||
import org.adempiere.exceptions.DBException;
|
import org.adempiere.exceptions.DBException;
|
||||||
import org.compiere.model.MColumn;
|
import org.compiere.model.MColumn;
|
||||||
import org.compiere.model.Query;
|
import org.compiere.model.Query;
|
||||||
|
@ -104,9 +105,10 @@ public class MWFNode extends X_AD_WF_Node
|
||||||
setXPosition (0);
|
setXPosition (0);
|
||||||
setYPosition (0);
|
setYPosition (0);
|
||||||
}
|
}
|
||||||
// Save to Cache
|
if (getAD_WF_Node_ID() > 0) {
|
||||||
if (get_ID() != 0)
|
loadNext();
|
||||||
s_cache.put (new Integer(getAD_WF_Node_ID()), this);
|
loadTrl();
|
||||||
|
}
|
||||||
} // MWFNode
|
} // MWFNode
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -137,7 +139,14 @@ public class MWFNode extends X_AD_WF_Node
|
||||||
loadNext();
|
loadNext();
|
||||||
loadTrl();
|
loadTrl();
|
||||||
// Save to Cache
|
// Save to Cache
|
||||||
s_cache.put (get_ID(), this);
|
Integer key = null;
|
||||||
|
try {
|
||||||
|
key = new Integer (rs.getInt("AD_WF_Node_ID"));
|
||||||
|
} catch (SQLException e) {
|
||||||
|
throw new AdempiereException(e);
|
||||||
|
}
|
||||||
|
if (key != null && trxName == null && !s_cache.containsKey(key))
|
||||||
|
s_cache.put (key, this);
|
||||||
} // MWFNode
|
} // MWFNode
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -216,7 +216,7 @@ public class HelpController
|
||||||
}
|
}
|
||||||
else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Process))
|
else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Process))
|
||||||
{
|
{
|
||||||
MProcess process = new MProcess(Env.getCtx(), recordId, null);
|
MProcess process = MProcess.get(Env.getCtx(), recordId);
|
||||||
if (!Env.isBaseLanguage(Env.getCtx(), "AD_Process")) {
|
if (!Env.isBaseLanguage(Env.getCtx(), "AD_Process")) {
|
||||||
|
|
||||||
nameMsg = process.get_Translation("Name");
|
nameMsg = process.get_Translation("Name");
|
||||||
|
@ -323,41 +323,24 @@ public class HelpController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Workflow)) {
|
else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Workflow)) {
|
||||||
MWorkflow workflow = new MWorkflow(Env.getCtx(), recordId, null);
|
MWorkflow workflow = MWorkflow.get(Env.getCtx(), recordId);
|
||||||
|
|
||||||
if (!Env.getLoginLanguage(Env.getCtx()).isBaseLanguage()) {
|
boolean trl = !Env.getLoginLanguage(Env.getCtx()).isBaseLanguage();
|
||||||
|
|
||||||
nameMsg = workflow.get_Translation("Name");
|
nameMsg = workflow.getName(trl);
|
||||||
|
|
||||||
if (workflow != null && nameMsg != null
|
if (workflow != null && nameMsg != null
|
||||||
&& nameMsg.length() != 0) {
|
&& nameMsg.length() != 0) {
|
||||||
sb.append("<br><br>\n<b>" + nameMsg + "</b>");
|
sb.append("<br><br>\n<b>" + nameMsg + "</b>");
|
||||||
|
|
||||||
descMsg = workflow.get_Translation("Description");
|
descMsg = workflow.getDescription(trl);
|
||||||
if (descMsg != null && descMsg.length() != 0)
|
if (descMsg != null && descMsg.length() != 0)
|
||||||
sb.append("<br><br>\n<i>" + descMsg + "</i>");
|
sb.append("<br><br>\n<i>" + descMsg + "</i>");
|
||||||
|
|
||||||
helpMsg = workflow.get_Translation("Help");
|
helpMsg = workflow.getHelp(trl);
|
||||||
if (helpMsg != null && helpMsg.length() != 0)
|
if (helpMsg != null && helpMsg.length() != 0)
|
||||||
sb.append("<br><br>\n" + helpMsg);
|
sb.append("<br><br>\n" + helpMsg);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
|
||||||
if (workflow != null && workflow.getName() != null
|
|
||||||
&& workflow.getName().length() != 0) {
|
|
||||||
sb.append("<br><br>\n<b>" + workflow.getName() + "</b>");
|
|
||||||
|
|
||||||
if (workflow.getDescription() != null
|
|
||||||
&& workflow.getDescription().length() != 0)
|
|
||||||
sb.append("<br><br>\n<i>"
|
|
||||||
+ workflow.getDescription() + "</i>");
|
|
||||||
|
|
||||||
if (workflow.getHelp() != null
|
|
||||||
&& workflow.getHelp().length() != 0)
|
|
||||||
sb.append("<br><br>\n" + workflow.getHelp());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Task)) {
|
} else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Task)) {
|
||||||
MTask task = new MTask(Env.getCtx(), recordId, null);
|
MTask task = new MTask(Env.getCtx(), recordId, null);
|
||||||
|
@ -395,40 +378,25 @@ public class HelpController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Node)) {
|
} else if (ctxType.equals(X_AD_CtxHelp.CTXTYPE_Node)) {
|
||||||
MWFNode node = new MWFNode(Env.getCtx(), recordId, null);
|
MWFNode node = MWFNode.get(Env.getCtx(), recordId);
|
||||||
|
|
||||||
if (!Env.getLoginLanguage(Env.getCtx()).isBaseLanguage()) {
|
boolean trl = !Env.getLoginLanguage(Env.getCtx()).isBaseLanguage();
|
||||||
|
|
||||||
nameMsg = node.get_Translation("Name");
|
|
||||||
|
|
||||||
if (node != null && nameMsg != null
|
nameMsg = node.getName(trl);
|
||||||
&& nameMsg.length() != 0) {
|
|
||||||
sb.append("<br><br>\n<b>" + nameMsg + "</b>");
|
|
||||||
|
|
||||||
descMsg = node.get_Translation("Description");
|
if (node != null && nameMsg != null
|
||||||
if (descMsg != null && descMsg.length() != 0)
|
&& nameMsg.length() != 0) {
|
||||||
sb.append("<br><br>\n<i>" + descMsg + "</i>");
|
sb.append("<br><br>\n<b>" + nameMsg + "</b>");
|
||||||
|
|
||||||
helpMsg = node.get_Translation("Help");
|
descMsg = node.getDescription(trl);
|
||||||
if (helpMsg != null && helpMsg.length() != 0)
|
if (descMsg != null && descMsg.length() != 0)
|
||||||
sb.append("<br><br>\n" + helpMsg);
|
sb.append("<br><br>\n<i>" + descMsg + "</i>");
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
helpMsg = node.getHelp(trl);
|
||||||
if (node != null && node.getName() != null
|
if (helpMsg != null && helpMsg.length() != 0)
|
||||||
&& node.getName().length() != 0) {
|
sb.append("<br><br>\n" + helpMsg);
|
||||||
sb.append("<br><br>\n<b>" + node.getName() + "</b>");
|
|
||||||
|
|
||||||
if (node.getDescription() != null
|
|
||||||
&& node.getDescription().length() != 0)
|
|
||||||
sb.append("<br><br>\n<i>" + node.getDescription()
|
|
||||||
+ "</i>");
|
|
||||||
|
|
||||||
if (node.getHelp() != null
|
|
||||||
&& node.getHelp().length() != 0)
|
|
||||||
sb.append("<br><br>\n" + node.getHelp());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue