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

@ -1283,18 +1283,18 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic
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"));