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)
return success;
// Sync Table ID
MSequence seq = MSequence.get(getCtx(), getTableName(), get_TrxName());
if (seq == null || seq.get_ID() == 0)
MSequence.createTableSequence(getCtx(), getTableName(), get_TrxName());
else if (!seq.getName().equals(getTableName()))
{
seq.setName(getTableName());
seq.saveEx();
if(!isView()) {
MSequence seq = MSequence.get(getCtx(), getTableName(), get_TrxName());
if (seq == null || seq.get_ID() == 0)
MSequence.createTableSequence(getCtx(), getTableName(), get_TrxName());
else if (!seq.getName().equals(getTableName()))
{
seq.setName(getTableName());
seq.saveEx();
}
}
if (newRecord || is_ValueChanged(COLUMNNAME_IsChangeLog)) {
MChangeLog.resetLoggedList();