IDEMPIERE-5254 - AD create postgres sequences and ad_sequence for views (#1293)

* IDEMPIERE-5254 - AD create postgres sequences and ad_sequence for views

* IDEMPIERE-5254 - adjusting !isView condition
This commit is contained in:
PeterTakacs300 2022-04-20 12:29:15 +02:00 committed by GitHub
parent c13039cf82
commit 41c3e115b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 7 deletions

View File

@ -721,13 +721,15 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport
if (!success) if (!success)
return success; return success;
// Sync Table ID // Sync Table ID
MSequence seq = MSequence.get(getCtx(), getTableName(), get_TrxName()); if(!isView()) {
if (seq == null || seq.get_ID() == 0) MSequence seq = MSequence.get(getCtx(), getTableName(), get_TrxName());
MSequence.createTableSequence(getCtx(), getTableName(), get_TrxName()); if (seq == null || seq.get_ID() == 0)
else if (!seq.getName().equals(getTableName())) MSequence.createTableSequence(getCtx(), getTableName(), get_TrxName());
{ else if (!seq.getName().equals(getTableName()))
seq.setName(getTableName()); {
seq.saveEx(); seq.setName(getTableName());
seq.saveEx();
}
} }
if (newRecord || is_ValueChanged(COLUMNNAME_IsChangeLog)) { if (newRecord || is_ValueChanged(COLUMNNAME_IsChangeLog)) {
MChangeLog.resetLoggedList(); MChangeLog.resetLoggedList();