From 41c3e115b1f3ab8f4294cd7815a91d337ff1edbe Mon Sep 17 00:00:00 2001 From: PeterTakacs300 <93127072+PeterTakacs300@users.noreply.github.com> Date: Wed, 20 Apr 2022 12:29:15 +0200 Subject: [PATCH] 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 --- .../src/org/compiere/model/MTable.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MTable.java b/org.adempiere.base/src/org/compiere/model/MTable.java index 749018d09e..509b1a052e 100644 --- a/org.adempiere.base/src/org/compiere/model/MTable.java +++ b/org.adempiere.base/src/org/compiere/model/MTable.java @@ -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();