IDEMPIERE-5205 PO is Immutable #resolve (#1327)

This commit is contained in:
Carlos Ruiz 2022-05-13 04:15:29 +02:00 committed by GitHub
parent f692c933da
commit eb15abb171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -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());