IDEMPIERE-5238 Record_ID editor (#1703)

- exclude AD_ChangeLog and AD_RecentItem from the validation to avoid affecting performance
This commit is contained in:
Carlos Ruiz 2023-03-08 12:58:59 +01:00 committed by GitHub
parent 7f7617328a
commit ff4516c86c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -5520,12 +5520,16 @@ public abstract class PO
* @return true if all the foreign keys are valid
*/
private void checkRecordIDCrossTenant() {
int idxTableId = p_info.getColumnIndex("AD_Table_ID");
if (idxTableId < 0)
// exclude read-only high-traffic tables
if ( MChangeLog.Table_Name.equals(get_TableName())
|| MRecentItem.Table_Name.equals(get_TableName()))
return;
int idxRecordId = p_info.getColumnIndex("Record_ID");
if (idxRecordId < 0)
return;
int idxTableId = p_info.getColumnIndex("AD_Table_ID");
if (idxTableId < 0)
return;
if ( ! (is_new() || is_ValueChanged(idxTableId) || is_ValueChanged(idxRecordId)))
return;
int recordId = get_ValueAsInt(idxRecordId);