IDEMPIERE-3665 Webservice 'updateData' prevents settings isProcessed to true (#194)
Moved before save to allow updating isProcessed Co-authored-by: Silvano Trinchero <strinchero@freepath.it>
This commit is contained in:
parent
600d8efc70
commit
20322a2b9d
|
@ -1282,19 +1282,19 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
|
||||||
if (po == null)
|
if (po == null)
|
||||||
return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName);
|
return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName);
|
||||||
POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID());
|
POInfo poinfo = POInfo.getPOInfo(ctx, table.getAD_Table_ID());
|
||||||
|
|
||||||
DataRow dr = modelCRUD.getDataRow();
|
|
||||||
|
|
||||||
StandardResponseDocument retResp = scanFields(dr.getFieldArray(), m_webservicetype, po, poinfo, trx, resp, ret);
|
|
||||||
if (retResp != null)
|
|
||||||
return retResp;
|
|
||||||
|
|
||||||
if(po.get_ColumnIndex("Processed")>=0 && po.get_ValueAsBoolean("Processed")){
|
if(po.get_ColumnIndex("Processed")>=0 && po.get_ValueAsBoolean("Processed")){
|
||||||
resp.setError("Record is processed and can not be updated");
|
resp.setError("Record is processed and can not be updated");
|
||||||
resp.setIsError(true);
|
resp.setIsError(true);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DataRow dr = modelCRUD.getDataRow();
|
||||||
|
|
||||||
|
StandardResponseDocument retResp = scanFields(dr.getFieldArray(), m_webservicetype, po, poinfo, trx, resp, ret);
|
||||||
|
if (retResp != null)
|
||||||
|
return retResp;
|
||||||
|
|
||||||
if (!po.save())
|
if (!po.save())
|
||||||
return rollbackAndSetError(trx, resp, ret, true, "Cannot save record in " + tableName + ": " + CLogger.retrieveErrorString("no log message"));
|
return rollbackAndSetError(trx, resp, ret, true, "Cannot save record in " + tableName + ": " + CLogger.retrieveErrorString("no log message"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue