IDEMPIERE-5865 : Cannot Update Always Updatable checked column via Web Service (#2025)
* IDEMPIERE-5865 : Cannot Update Always Updatable checked column via Web Service * IDEMPIERE-5865 : Cannot Update Always Updatable checked column via Web Service #2
This commit is contained in:
parent
b01dbc2f11
commit
793ffe6aef
|
@ -1008,12 +1008,6 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
|
|||
if (po == null)
|
||||
return rollbackAndSetError(trx, resp, ret, true, "Cannot create PO for " + tableName);
|
||||
|
||||
if (po.get_ColumnIndex("Processed") >= 0 && po.get_ValueAsBoolean("Processed")) {
|
||||
resp.setError("Record not updatable for " + table.getTableName() + "_ID = " + record_id);
|
||||
resp.setIsError(true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Setting value back from holder to new persistent po
|
||||
for (DataField field : fields) {
|
||||
int indx = poinfo.getColumnIndex(field.getColumn());
|
||||
|
@ -1186,6 +1180,8 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
|
|||
//Clear ctx
|
||||
Env.clearWinContext(Env.getCtx(),0);
|
||||
|
||||
boolean isProcessed = po.get_ColumnIndex("Processed")>=0 && po.get_ValueAsBoolean("Processed");
|
||||
|
||||
for (DataField field : fields) {
|
||||
// Implement lookup
|
||||
X_WS_WebServiceFieldInput fieldInput = m_webservicetype.getFieldInput(field.getColumn());
|
||||
|
@ -1213,6 +1209,9 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
|
|||
+ ": input column " + field.getColumn() + " does not exist");
|
||||
} else {
|
||||
try {
|
||||
if(!MColumn.get(fieldInput.getAD_Column_ID()).isAlwaysUpdateable() && isProcessed)
|
||||
throw new IdempiereServiceFault("Document Processed", new QName("ProcessedDocument"));
|
||||
|
||||
setValueAccordingToClass(po, poinfo, field, idxcol,fieldInput);
|
||||
} catch (IdempiereServiceFault e) {
|
||||
log.log(Level.WARNING, "Error setting value", e);
|
||||
|
@ -1289,12 +1288,6 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
|
|||
return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName);
|
||||
POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID());
|
||||
|
||||
if(po.get_ColumnIndex("Processed")>=0 && po.get_ValueAsBoolean("Processed")){
|
||||
resp.setError("Record is processed and can not be updated");
|
||||
resp.setIsError(true);
|
||||
return ret;
|
||||
}
|
||||
|
||||
DataRow dr = modelCRUD.getDataRow();
|
||||
|
||||
StandardResponseDocument retResp = scanFields(dr.getFieldArray(), m_webservicetype, po, poinfo, trx, resp, ret);
|
||||
|
|
Loading…
Reference in New Issue