Skip to content

Commit

Permalink
after ESR import, ask the framework to refresh the ESR_Import
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed Oct 4, 2017
1 parent b14877a commit b09f066
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.metas.payment.esr.process;

import org.adempiere.util.Services;
import org.adempiere.util.lang.impl.TableRecordReference;

import de.metas.async.model.I_C_Async_Batch;
import de.metas.attachments.AttachmentEntry;
Expand Down Expand Up @@ -57,8 +58,9 @@ protected String doIt()
{
final AttachmentEntry fromAttachmentEntry = attachmentDAO.retrieveAttachmentEntryById(-1, p_AD_AttachmentEntry_ID); // attachmentId = -1

final I_ESR_Import esrImport = getRecord(I_ESR_Import.class);
ESRImportEnqueuer.newInstance()
.esrImport(getRecord(I_ESR_Import.class))
.esrImport(esrImport)
.fromDataSource(ESRImportEnqueuerDataSource.builder()
.filename(fromAttachmentEntry.getFilename())
.content(attachmentDAO.retrieveData(fromAttachmentEntry))
Expand All @@ -74,7 +76,9 @@ protected String doIt()
.duplicateFilePolicy(ESRImportEnqueuerDuplicateFilePolicy.NEVER)
//
.execute();


getResult().setRecordToRefreshAfterExecution(TableRecordReference.of(esrImport));

return MSG_OK;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.adempiere.exceptions.FillMandatoryException;
import org.adempiere.model.InterfaceWrapperHelper;
import org.adempiere.util.Services;
import org.adempiere.util.lang.impl.TableRecordReference;
import org.compiere.util.Env;

import de.metas.adempiere.form.IClientUI;
Expand Down Expand Up @@ -63,8 +64,9 @@ public Object getParameterDefaultValue(@NonNull final IProcessDefaultParameter p
@RunOutOfTrx // ...because we might show a dialog to the user
protected String doIt() throws Exception
{
final I_ESR_Import esrImport = retrieveESR_Import();
ESRImportEnqueuer.newInstance()
.esrImport(retrieveESR_Import())
.esrImport(esrImport)
.fromDataSource(ESRImportEnqueuerDataSource.ofFile(p_FileName))
//
.asyncBatchName(p_AsyncBatchName)
Expand Down Expand Up @@ -93,6 +95,8 @@ public void onNotImportingDuplicateFile()
//
.execute();

getResult().setRecordToRefreshAfterExecution(TableRecordReference.of(esrImport));

return MSG_OK;
}

Expand Down

0 comments on commit b09f066

Please sign in to comment.