IDEMPIERE-4736 FHCA-2461 IDEMP - ad_column table - Framework query improvement (#628)

* IDEMPIERE-4736 FHCA-2461 IDEMP - ad_column table - Framework query improvement

* * Rename migration scripts to normal convention
This commit is contained in:
Carlos Ruiz 2021-03-16 10:03:40 +01:00 committed by GitHub
parent 86bbb08bff
commit c8fd9a8805
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 5 deletions

View File

@ -0,0 +1,10 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Mar 9, 2021, 1:20:04 PM CET
UPDATE AD_Ref_Table SET WhereClause='AD_Table.IsView=''N'' AND AD_Table.IsActive=''Y'' AND EXISTS (SELECT 1 FROM AD_Column c WHERE c.AD_Table_ID=AD_Table.AD_Table_ID AND UPPER(c.ColumnName)=UPPER(AD_Table.TableName)||''_ID'' AND c.IsActive=''Y'')',Updated=TO_DATE('2021-03-09 13:20:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=200165
;
SELECT register_migration_script('202103091322_IDEMPIERE-4736.sql') FROM dual
;

View File

@ -0,0 +1,7 @@
-- Mar 9, 2021, 1:20:04 PM CET
UPDATE AD_Ref_Table SET WhereClause='AD_Table.IsView=''N'' AND AD_Table.IsActive=''Y'' AND EXISTS (SELECT 1 FROM AD_Column c WHERE c.AD_Table_ID=AD_Table.AD_Table_ID AND UPPER(c.ColumnName)=UPPER(AD_Table.TableName)||''_ID'' AND c.IsActive=''Y'')',Updated=TO_TIMESTAMP('2021-03-09 13:20:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=200165
;
SELECT register_migration_script('202103091322_IDEMPIERE-4736.sql') FROM dual
;

View File

@ -972,7 +972,7 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "SELECT AD_Table_ID, AccessLevel, TableName, IsView, "
+ "(SELECT ColumnName FROM AD_COLUMN WHERE AD_COLUMN.AD_TABLE_ID = AD_TABLE.AD_TABLE_ID AND AD_COLUMN.COLUMNNAME = AD_TABLE.TABLENAME || '_ID') "
+ "(SELECT ColumnName FROM AD_COLUMN WHERE AD_COLUMN.AD_TABLE_ID = AD_TABLE.AD_TABLE_ID AND UPPER(AD_COLUMN.COLUMNNAME) = UPPER(AD_TABLE.TABLENAME) || '_ID') "
+ "FROM AD_Table WHERE IsActive='Y'";
try
{

View File

@ -840,7 +840,7 @@ public class Login
Ini.setProperty(Ini.P_PRINTER, printerName);
// Load Role Info
MRole.getDefault(m_ctx, true);
MRole.getDefault(m_ctx, false);
// Other
loadUserPreferences();

View File

@ -686,9 +686,9 @@ public class RolePanel extends Window implements EventListener<Event>, Deferrabl
userPreference.setProperty(UserPreference.P_WAREHOUSE, lstItemWarehouse != null ? (String) lstItemWarehouse.getValue() : "0");
userPreference.savePreference();
//force reload of default role
MRole.getDefault(m_ctx, true);
//force reload of default role when more than 1 client
if (lstClient.getChildren().size() > 1)
MRole.getDefault(m_ctx, true);
//
}