From 5979f65bbd5ed23629bbda4d433cd051af65247a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 17 Sep 2021 15:07:50 +0200 Subject: [PATCH] IDEMPIERE-2853 Panel tab as a factory - preserve AD_Tab.IsSortTab for backward compatibility (#885) --- .../i8.2z/oracle/202109171424_IDEMPIERE-2853.sql | 16 ++++++++++++++++ .../postgresql/202109171424_IDEMPIERE-2853.sql | 13 +++++++++++++ .../src/org/compiere/model/MTab.java | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 migration/i8.2z/oracle/202109171424_IDEMPIERE-2853.sql create mode 100644 migration/i8.2z/postgresql/202109171424_IDEMPIERE-2853.sql diff --git a/migration/i8.2z/oracle/202109171424_IDEMPIERE-2853.sql b/migration/i8.2z/oracle/202109171424_IDEMPIERE-2853.sql new file mode 100644 index 0000000000..4b99e928c5 --- /dev/null +++ b/migration/i8.2z/oracle/202109171424_IDEMPIERE-2853.sql @@ -0,0 +1,16 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2853 Panel tab as a factory +-- preserve AD_Tab.IsSortTab for backward compatibility +-- Sep 17, 2021, 2:24:03 PM CEST +UPDATE AD_Field SET IsDisplayed='N', IsActive='Y', IsReadOnly='Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsDisplayedGrid='N', IsToolbarButton=NULL,Updated=TO_DATE('2021-09-17 14:24:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5707 +; + +UPDATE AD_Tab SET IsSortTab='Y' WHERE AD_TabType='SORT' AND (IsSortTab IS NULL OR IsSortTab!='Y'); + +UPDATE AD_Tab SET IsSortTab='N' WHERE AD_TabType!='SORT' AND (IsSortTab IS NULL OR IsSortTab!='N'); + +SELECT register_migration_script('202109171424_IDEMPIERE-2853.sql') FROM dual +; + diff --git a/migration/i8.2z/postgresql/202109171424_IDEMPIERE-2853.sql b/migration/i8.2z/postgresql/202109171424_IDEMPIERE-2853.sql new file mode 100644 index 0000000000..f6aa5ca8b7 --- /dev/null +++ b/migration/i8.2z/postgresql/202109171424_IDEMPIERE-2853.sql @@ -0,0 +1,13 @@ +-- IDEMPIERE-2853 Panel tab as a factory +-- preserve AD_Tab.IsSortTab for backward compatibility +-- Sep 17, 2021, 2:24:03 PM CEST +UPDATE AD_Field SET IsDisplayed='N', IsActive='Y', IsReadOnly='Y', AD_Reference_Value_ID=NULL, AD_Val_Rule_ID=NULL, IsDisplayedGrid='N', IsToolbarButton=NULL,Updated=TO_TIMESTAMP('2021-09-17 14:24:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5707 +; + +UPDATE AD_Tab SET IsSortTab='Y' WHERE AD_TabType='SORT' AND (IsSortTab IS NULL OR IsSortTab!='Y'); + +UPDATE AD_Tab SET IsSortTab='N' WHERE AD_TabType!='SORT' AND (IsSortTab IS NULL OR IsSortTab!='N'); + +SELECT register_migration_script('202109171424_IDEMPIERE-2853.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/MTab.java b/org.adempiere.base/src/org/compiere/model/MTab.java index b7c5f373c6..62134e6627 100644 --- a/org.adempiere.base/src/org/compiere/model/MTab.java +++ b/org.adempiere.base/src/org/compiere/model/MTab.java @@ -216,6 +216,8 @@ public class MTab extends X_AD_Tab implements ImmutablePOSupport { if (isReadOnly() && isInsertRecord()) setIsInsertRecord(false); + if (is_new() || is_ValueChanged(COLUMNNAME_AD_TabType)) + setIsSortTab(AD_TABTYPE_Sort.equals(getAD_TabType())); // preserve this redundant flag for backward compatibility //RF[2826384] if(isSortTab()) {