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 * @return true if all the foreign keys are valid
*/ */
private void checkRecordIDCrossTenant() { private void checkRecordIDCrossTenant() {
int idxTableId = p_info.getColumnIndex("AD_Table_ID"); // exclude read-only high-traffic tables
if (idxTableId < 0) if ( MChangeLog.Table_Name.equals(get_TableName())
|| MRecentItem.Table_Name.equals(get_TableName()))
return; return;
int idxRecordId = p_info.getColumnIndex("Record_ID"); int idxRecordId = p_info.getColumnIndex("Record_ID");
if (idxRecordId < 0) if (idxRecordId < 0)
return; return;
int idxTableId = p_info.getColumnIndex("AD_Table_ID");
if (idxTableId < 0)
return;
if ( ! (is_new() || is_ValueChanged(idxTableId) || is_ValueChanged(idxRecordId))) if ( ! (is_new() || is_ValueChanged(idxTableId) || is_ValueChanged(idxRecordId)))
return; return;
int recordId = get_ValueAsInt(idxRecordId); int recordId = get_ValueAsInt(idxRecordId);