IDEMPIERE-5077 Process (gear) button unusable when the workflow is suspended (#1031)

This commit is contained in:
Carlos Ruiz 2021-12-08 10:17:01 +01:00 committed by GitHub
parent 78296f9178
commit 83c4b16882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -60,7 +60,7 @@ public class ProcessButtonPopup extends Menupopup implements EventListener<Event
//document actions
if (docActionBtn != null) {
IProcessButton processButton = (IProcessButton) docActionBtn.getAttribute(WButtonEditor.EDITOR_ATTRIBUTE);
WDocActionPanel actionPanel = new WDocActionPanel(processButton.getADTabpanel().getGridTab());
WDocActionPanel actionPanel = new WDocActionPanel(processButton.getADTabpanel().getGridTab(), true);
List<Listitem> actions = actionPanel.getDocActionItems();
if (actions.size() > 0) {
if (this.getChildren().size() > 0)

View File

@ -69,7 +69,7 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
/**
*
*/
private static final long serialVersionUID = -2166149559040327486L;
private static final long serialVersionUID = -3218367479851088526L;
private Label lblDocAction;
private Label label;
@ -93,6 +93,11 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
}
public WDocActionPanel(GridTab mgridTab)
{
this(mgridTab, false);
}
public WDocActionPanel(GridTab mgridTab, boolean fromMenu)
{
gridTab = mgridTab;
DocStatus = (String)gridTab.getValue("DocStatus");
@ -102,15 +107,16 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
readReference();
initComponents();
dynInit();
dynInit(fromMenu);
init();
}
/**
* Dynamic Init - determine valid DocActions based on DocStatus for the different documents.
* @param fromMenu
*/
private void dynInit()
private void dynInit(boolean fromMenu)
{
//
@ -149,6 +155,7 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
String wfStatus = MWFActivity.getActiveInfo(Env.getCtx(), m_AD_Table_ID, gridTab.getRecord_ID());
if (wfStatus != null)
{
if (! fromMenu)
FDialog.error(gridTab.getWindowNo(), this, "WFActiveForRecord", wfStatus);
return;
}