IDEMPIERE-1297 2Pack: Remove code for the lookup of record and reference using business key. Fixed handling of column that reference zero id table.

This commit is contained in:
Heng Sin Low 2013-09-07 02:37:10 +08:00
parent 9b84f465db
commit 01807c9191
1 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.List;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MColumn;
import org.compiere.model.MTable;
import org.compiere.model.PO;
import org.compiere.model.POInfo;
@ -161,7 +162,13 @@ public class PoFiller{
po.set_ValueNoCheck(columnName, id);
}
return id;
}
} else if (id == 0) {
MColumn col = MColumn.get(ctx.ctx, po.get_TableName(), columnName);
if (MTable.isZeroIDTable(col.getReferenceTableName())) {
po.set_ValueNoCheck(columnName, id);
return id;
}
}
return -1;
} else {
return 0;