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.MInfoWindow;
|
||||||
import org.compiere.model.MProcess;
|
import org.compiere.model.MProcess;
|
||||||
import org.compiere.model.MTab;
|
import org.compiere.model.MTab;
|
||||||
|
import org.compiere.model.MTable;
|
||||||
import org.compiere.model.MTask;
|
import org.compiere.model.MTask;
|
||||||
import org.compiere.model.MUserDefInfo;
|
import org.compiere.model.MUserDefInfo;
|
||||||
import org.compiere.model.PO;
|
import org.compiere.model.PO;
|
||||||
|
@ -223,8 +224,17 @@ public class WCtxHelpSuggestion extends Window implements EventListener<Event> {
|
||||||
ctxHelp.saveEx();
|
ctxHelp.saveEx();
|
||||||
|
|
||||||
if (po != null) {
|
if (po != null) {
|
||||||
po.set_ValueOfColumn("AD_CtxHelp_ID", ctxHelp.getAD_CtxHelp_ID());
|
if (po.is_Immutable()) {
|
||||||
po.saveEx(trx.getTrxName());
|
// 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());
|
suggestion.setAD_CtxHelp_ID(ctxHelp.getAD_CtxHelp_ID());
|
||||||
|
|
Loading…
Reference in New Issue