IDEMPIERE-5205 PO is Immutable #resolve (#1327)
This commit is contained in:
parent
f692c933da
commit
eb15abb171
|
@ -16,6 +16,7 @@ import org.compiere.model.MForm;
|
|||
import org.compiere.model.MInfoWindow;
|
||||
import org.compiere.model.MProcess;
|
||||
import org.compiere.model.MTab;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.model.MTask;
|
||||
import org.compiere.model.MUserDefInfo;
|
||||
import org.compiere.model.PO;
|
||||
|
@ -223,9 +224,18 @@ public class WCtxHelpSuggestion extends Window implements EventListener<Event> {
|
|||
ctxHelp.saveEx();
|
||||
|
||||
if (po != null) {
|
||||
if (po.is_Immutable()) {
|
||||
// get a new not immutable PO
|
||||
MTable table = MTable.get(po.get_Table_ID());
|
||||
PO mutablePO = table.getPO(po.get_ID(), trx.getTrxName());
|
||||
mutablePO.set_ValueOfColumn("AD_CtxHelp_ID", ctxHelp.getAD_CtxHelp_ID());
|
||||
mutablePO.saveEx(trx.getTrxName());
|
||||
po.load(trx.getTrxName());
|
||||
} else {
|
||||
po.set_ValueOfColumn("AD_CtxHelp_ID", ctxHelp.getAD_CtxHelp_ID());
|
||||
po.saveEx(trx.getTrxName());
|
||||
}
|
||||
}
|
||||
|
||||
suggestion.setAD_CtxHelp_ID(ctxHelp.getAD_CtxHelp_ID());
|
||||
MCtxHelpMsg msg = new MCtxHelpMsg(Env.getCtx(), 0, trx.getTrxName());
|
||||
|
|
Loading…
Reference in New Issue