IDEMPIERE-5826 iDempiere REST can insert/update an invalid foreign key (#1969)

This commit is contained in:
Carlos Ruiz 2023-08-15 10:51:44 +02:00 committed by GitHub
parent 66b7b20619
commit db833e3665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -5757,9 +5757,7 @@ public abstract class PO
} else { } else {
fkval = Integer.valueOf(get_ValueAsInt(index)); fkval = Integer.valueOf(get_ValueAsInt(index));
} }
if (fkval != null if (fkval != null) {
&& ( (fkval instanceof Integer && ((Integer)fkval).intValue() > 0)
|| (fkval instanceof String && ((String)fkval).length() > 0) )) {
MTable ft = MTable.get(getCtx(), fktab); MTable ft = MTable.get(getCtx(), fktab);
boolean systemAccess = false; boolean systemAccess = false;
String accessLevel = ft.getAccessLevel(); String accessLevel = ft.getAccessLevel();