IDEMPIERE-5036 NPE auto-opening a process (#973)

This commit is contained in:
Carlos Ruiz 2021-11-12 03:51:42 +01:00 committed by GitHub
parent 2888a27fec
commit 149a47b044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1053,7 +1053,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
if (isActionURL()) // IDEMPIERE-2334 vs IDEMPIERE-3000 - do not open windows when coming from an action URL
return;
StringBuilder sql = new StringBuilder("SELECT m.Action, COALESCE(m.AD_Window_ID, m.AD_Process_ID, m.AD_Form_ID, m.AD_Workflow_ID, m.AD_Task_ID, m.AD_InfoWindow_ID) ")
StringBuilder sql = new StringBuilder("SELECT m.Action, COALESCE(m.AD_Window_ID, m.AD_Process_ID, m.AD_Form_ID, m.AD_Workflow_ID, m.AD_Task_ID, m.AD_InfoWindow_ID), m.AD_Menu_ID ")
.append(" FROM AD_Tree_Favorite_Node tfn ")
.append(" INNER JOIN AD_Menu m ON (tfn.AD_Menu_ID = m.AD_Menu_ID) ")
.append(" WHERE tfn.AD_Tree_Favorite_ID = ")
@ -1067,6 +1067,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
String action = (String) row.get(0);
int recordID = ((BigDecimal) row.get(1)).intValue();
int menuID = ((BigDecimal) row.get(2)).intValue();
if (action.equals(MMenu.ACTION_Form)) {
Boolean access = MRole.getDefault().getFormAccess(recordID);
@ -1081,7 +1082,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
else if (action.equals(MMenu.ACTION_Process) || action.equals(MMenu.ACTION_Report)) {
Boolean access = MRole.getDefault().getProcessAccess(recordID);
if (access != null && access)
SessionManager.getAppDesktop().openProcessDialog(recordID, DB.getSQLValueStringEx(null, "SELECT IsSOTrx FROM AD_Menu WHERE AD_Menu_ID = ?", recordID).equals("Y"));
SessionManager.getAppDesktop().openProcessDialog(recordID, DB.getSQLValueStringEx(null, "SELECT IsSOTrx FROM AD_Menu WHERE AD_Menu_ID = ?", menuID).equals("Y"));
}
else if (action.equals(MMenu.ACTION_Task)) {
Boolean access = MRole.getDefault().getTaskAccess(recordID);