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:
Carlos Ruiz 2020-07-31 02:05:40 +02:00 committed by GitHub
parent 600d8efc70
commit 20322a2b9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -1282,19 +1282,19 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
if (po == null)
return rollbackAndSetError(trx, resp, ret, true, "No Record " + recordID + " in " + tableName);
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")){
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);
if (retResp != null)
return retResp;
if (!po.save())
return rollbackAndSetError(trx, resp, ret, true, "Cannot save record in " + tableName + ": " + CLogger.retrieveErrorString("no log message"));