Skip to content

Commit

Permalink
EDI support multiple SSCCs per DESADV-Line
Browse files Browse the repository at this point in the history
* hope to fix failing tests after "recreate invoice candidate model classes and fix compile problems in the process"
#5846

(cherry picked from commit 0965f40)
  • Loading branch information
metas-ts committed Dec 17, 2019
1 parent f9938d5 commit 03dda02
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -3,6 +3,8 @@
import static org.adempiere.model.InterfaceWrapperHelper.createOld;
import static org.adempiere.model.InterfaceWrapperHelper.getCtx;
import static org.adempiere.model.InterfaceWrapperHelper.loadOutOfTrx;
import static org.adempiere.model.InterfaceWrapperHelper.newInstance;
import static org.adempiere.model.InterfaceWrapperHelper.saveRecord;
import static org.adempiere.model.InterfaceWrapperHelper.translate;

/*
Expand Down Expand Up @@ -42,6 +44,7 @@
import org.adempiere.ad.table.api.IADTableDAO;
import org.adempiere.ad.trx.api.ITrx;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.Adempiere;
import org.compiere.model.I_AD_Column;
import org.compiere.model.I_AD_Element;
import org.compiere.model.I_AD_Table;
Expand Down Expand Up @@ -79,6 +82,15 @@ public I_AD_Column retrieveColumn(@NonNull final AdTableId tableId, @NonNull fin

if (columnRecord == null)
{
if (Adempiere.isUnitTestMode())
{
final I_AD_Column newColumnRecord = newInstance(I_AD_Column.class);
newColumnRecord.setAD_Table_ID(tableId.getRepoId());
newColumnRecord.setColumnName(columnName);
newColumnRecord.setName(columnName + " + on-the-fly created for unit-test");
saveRecord(newColumnRecord);
return newColumnRecord;
}
throw new AdempiereException("@NotFound@ @AD_Column_ID@ " + columnName + " (@AD_Table_ID@=" + tableId + ")");
}
return columnRecord;
Expand Down

0 comments on commit 03dda02

Please sign in to comment.