diff --git a/migration/i8.1z/oracle/202011121113_IDEMPIERE-4542.sql b/migration/i8.1z/oracle/202011121113_IDEMPIERE-4542.sql new file mode 100644 index 0000000000..df146799e4 --- /dev/null +++ b/migration/i8.1z/oracle/202011121113_IDEMPIERE-4542.sql @@ -0,0 +1,27 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-4542 Cannot report from window _My Unprocessed Documents_ +-- Nov 12, 2020, 11:05:07 AM CET +UPDATE PA_DocumentStatus SET WhereClause='RV_Unprocessed.AD_Client_ID=@#AD_Client_ID@ AND RV_Unprocessed.CreatedBy=@#AD_User_ID@',Updated=TO_DATE('2020-11-12 11:05:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DocumentStatus_ID=200005 +; + +-- Nov 12, 2020, 11:36:21 AM CET +UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_DATE('2020-11-12 11:36:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200223 +; + +-- Nov 12, 2020, 11:38:45 AM CET +UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_DATE('2020-11-12 11:38:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200191 +; + +-- Nov 12, 2020, 11:40:02 AM CET +UPDATE PA_DocumentStatus SET WhereClause='AD_Note.AD_Client_ID=@#AD_Client_ID@ AND AD_Note.AD_User_ID IN (0,@#AD_User_ID@) AND AD_Note.Processed=''N'' AND AD_Note.AD_BroadcastMessage_ID IS NULL',Updated=TO_DATE('2020-11-12 11:40:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DocumentStatus_ID=200002 +; + +-- Nov 12, 2020, 11:40:43 AM CET +UPDATE PA_DocumentStatus SET WhereClause='(R_Request.SalesRep_ID=@#AD_User_ID@ OR R_Request.AD_Role_ID=@#AD_Role_ID@) AND R_Request.Processed=''N'' AND (R_Request.DateNextAction IS NULL OR TRUNC(R_Request.DateNextAction) <= TRUNC(SysDate)) AND (R_Request.R_Status_ID IS NULL OR R_Request.R_Status_ID IN (SELECT R_Status.R_Status_ID FROM R_Status WHERE R_Status.IsClosed=''N''))',Updated=TO_DATE('2020-11-12 11:40:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DocumentStatus_ID=200003 +; + +SELECT register_migration_script('202011121113_IDEMPIERE-4542.sql') FROM dual +; + diff --git a/migration/i8.1z/postgresql/202011121113_IDEMPIERE-4542.sql b/migration/i8.1z/postgresql/202011121113_IDEMPIERE-4542.sql new file mode 100644 index 0000000000..1a85d634b4 --- /dev/null +++ b/migration/i8.1z/postgresql/202011121113_IDEMPIERE-4542.sql @@ -0,0 +1,24 @@ +-- IDEMPIERE-4542 Cannot report from window _My Unprocessed Documents_ +-- Nov 12, 2020, 11:05:07 AM CET +UPDATE PA_DocumentStatus SET WhereClause='RV_Unprocessed.AD_Client_ID=@#AD_Client_ID@ AND RV_Unprocessed.CreatedBy=@#AD_User_ID@',Updated=TO_TIMESTAMP('2020-11-12 11:05:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DocumentStatus_ID=200005 +; + +-- Nov 12, 2020, 11:36:21 AM CET +UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_TIMESTAMP('2020-11-12 11:36:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200223 +; + +-- Nov 12, 2020, 11:38:45 AM CET +UPDATE AD_Tab SET IsAdvancedTab='Y',Updated=TO_TIMESTAMP('2020-11-12 11:38:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=200191 +; + +-- Nov 12, 2020, 11:40:02 AM CET +UPDATE PA_DocumentStatus SET WhereClause='AD_Note.AD_Client_ID=@#AD_Client_ID@ AND AD_Note.AD_User_ID IN (0,@#AD_User_ID@) AND AD_Note.Processed=''N'' AND AD_Note.AD_BroadcastMessage_ID IS NULL',Updated=TO_TIMESTAMP('2020-11-12 11:40:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DocumentStatus_ID=200002 +; + +-- Nov 12, 2020, 11:40:43 AM CET +UPDATE PA_DocumentStatus SET WhereClause='(R_Request.SalesRep_ID=@#AD_User_ID@ OR R_Request.AD_Role_ID=@#AD_Role_ID@) AND R_Request.Processed=''N'' AND (R_Request.DateNextAction IS NULL OR TRUNC(R_Request.DateNextAction) <= TRUNC(SysDate)) AND (R_Request.R_Status_ID IS NULL OR R_Request.R_Status_ID IN (SELECT R_Status.R_Status_ID FROM R_Status WHERE R_Status.IsClosed=''N''))',Updated=TO_TIMESTAMP('2020-11-12 11:40:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE PA_DocumentStatus_ID=200003 +; + +SELECT register_migration_script('202011121113_IDEMPIERE-4542.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java b/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java index ceee098ff9..d0f8963ce9 100644 --- a/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java +++ b/org.adempiere.base/src/org/compiere/model/MDocumentStatus.java @@ -102,14 +102,15 @@ public class MDocumentStatus extends X_PA_DocumentStatus { } public static String getWhereClause(MDocumentStatus documentStatus) { - StringBuilder where = new StringBuilder(" AD_Client_ID=" + Env.getAD_Client_ID(Env.getCtx()) ); + String tableName = MTable.getTableName(Env.getCtx(), documentStatus.getAD_Table_ID()); + StringBuilder where = new StringBuilder(" ").append(tableName).append(".AD_Client_ID=" + Env.getAD_Client_ID(Env.getCtx()) ); if (documentStatus.getC_Project_ID() > 0) { - where.append(" AND C_Project_ID=").append(documentStatus.getC_Project_ID()); + where.append(" AND ").append(tableName).append(".C_Project_ID=").append(documentStatus.getC_Project_ID()); } if (documentStatus.getAD_Org_ID() > 0) { - where.append(" AND AD_Org_ID=").append(documentStatus.getAD_Org_ID()); + where.append(" AND ").append(tableName).append(".AD_Org_ID=").append(documentStatus.getAD_Org_ID()); } String extra = documentStatus.getWhereClause(); if (extra != null && extra.trim().length() > 0) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WDocumentStatusIndicator.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WDocumentStatusIndicator.java index 440b2cc4a4..5718eb17a6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WDocumentStatusIndicator.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WDocumentStatusIndicator.java @@ -162,6 +162,7 @@ public class WDocumentStatusIndicator extends Panel implements EventListener