From fefc1c0ee364ca83cc9283732fe996ed8b01f736 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 22 Mar 2013 16:05:26 -0500 Subject: [PATCH] IDEMPIERE-780 On Invoice Gen/Shipment Gen, Document Action (make that field mandatory) / based on patch from Richard Morales --- .../WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java | 3 +++ .../src/org/adempiere/webui/apps/form/WInvoiceGen.java | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java index a1e17f0d80..fc1f1cec6d 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java @@ -192,6 +192,9 @@ public class WInOutGen extends InOutGen implements IFormController, EventListene { throw new WrongValueException(fWarehouse.getComponent(), Msg.translate(Env.getCtx(), "FillMandatory")); } + String docActionSelected = (String)docAction.getValue(); + if ( docActionSelected==null || docActionSelected.isEmpty() ) + throw new WrongValueException(docAction.getComponent(), Msg.translate(Env.getCtx(), "FillMandatory")); form.saveSelection(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInvoiceGen.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInvoiceGen.java index b2b1a38b40..6fc194243b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInvoiceGen.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WInvoiceGen.java @@ -37,6 +37,7 @@ import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.KeyNamePair; import org.compiere.util.Msg; +import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zul.Space; @@ -186,6 +187,10 @@ public class WInvoiceGen extends InvoiceGen implements IFormController, EventLis public void validate() { + String docActionSelected = (String)docAction.getValue(); + if ( docActionSelected==null || docActionSelected.isEmpty() ) + throw new WrongValueException(docAction.getComponent(), Msg.translate(Env.getCtx(), "FillMandatory")); + form.saveSelection(); ArrayList selection = getSelection();