[ 2877874 ] Show error if document has no process associated
https://sourceforge.net/tracker/?func=detail&aid=2877874&group_id=176962&atid=879332 Implemented to Swing and ZK. Please review.
This commit is contained in:
parent
9a88ece081
commit
a9776d5284
|
@ -2307,6 +2307,8 @@ public final class APanel extends CPanel
|
|||
return;
|
||||
}
|
||||
|
||||
boolean isProcessMandatory = false;
|
||||
|
||||
// Pop up Payment Rules
|
||||
if (col.equals("PaymentRule"))
|
||||
{
|
||||
|
@ -2324,6 +2326,7 @@ public final class APanel extends CPanel
|
|||
// Pop up Document Action (Workflow)
|
||||
else if (col.equals("DocAction"))
|
||||
{
|
||||
isProcessMandatory = true;
|
||||
VDocAction vda = new VDocAction(m_curWindowNo, m_curTab, vButton, record_ID);
|
||||
// Something to select from?
|
||||
if (vda.getNumberOfOptions() == 0)
|
||||
|
@ -2425,7 +2428,13 @@ public final class APanel extends CPanel
|
|||
|
||||
log.config("Process_ID=" + vButton.getProcess_ID() + ", Record_ID=" + record_ID);
|
||||
if (vButton.getProcess_ID() == 0)
|
||||
{
|
||||
if (isProcessMandatory)
|
||||
{
|
||||
ADialog.error(m_curWindowNo, this, null, Msg.parseTranslation(m_ctx, "@NotFound@ @AD_Process_ID@"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Save item changed
|
||||
if (m_curTab.needSave(true, false))
|
||||
if (!cmd_save(true))
|
||||
|
|
|
@ -71,7 +71,6 @@ import org.compiere.util.DisplayType;
|
|||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.WebDoc;
|
||||
import org.jfree.util.Log;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.HtmlBasedComponent;
|
||||
|
@ -1705,6 +1704,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
|||
return;
|
||||
}
|
||||
|
||||
boolean isProcessMandatory = false;
|
||||
|
||||
// Pop up Payment Rules
|
||||
|
||||
if (col.equals("PaymentRule"))
|
||||
|
@ -1730,6 +1731,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
|||
|
||||
else if (col.equals("DocAction"))
|
||||
{
|
||||
isProcessMandatory = true;
|
||||
WDocActionPanel win = new WDocActionPanel(curTab);
|
||||
if (win.getNumberOfOptions() == 0)
|
||||
{
|
||||
|
@ -1834,7 +1836,13 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
|||
logger.config("Process_ID=" + wButton.getProcess_ID() + ", Record_ID=" + record_ID);
|
||||
|
||||
if (wButton.getProcess_ID() == 0)
|
||||
{
|
||||
if (isProcessMandatory)
|
||||
{
|
||||
FDialog.error(curWindowNo, null, null, Msg.parseTranslation(ctx, "@NotFound@ @AD_Process_ID@"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Save item changed
|
||||
|
||||
|
|
Loading…
Reference in New Issue