From eb033e30d4eacad28eee389834207db8aa7f911f Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Wed, 8 Jul 2009 15:34:33 +0000 Subject: [PATCH] [ 2818420 ] Throw exception when Warehouse is not completed https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2818420&group_id=176962 --- .../adempiere/webui/apps/form/WInOutGen.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java index 9455d62b9d..a6720cd86a 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/apps/form/WInOutGen.java @@ -129,7 +129,7 @@ public class WInOutGen extends InOutGen implements ICustomForm, EventListener, V lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID")); fWarehouse.addValueChangeListener(this); fWarehouse.setValue(Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID")); - m_M_Warehouse_ID = fWarehouse.getValue(); + setM_Warehouse_ID(fWarehouse.getValue()); // Document Action Prepared/ Completed lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction")); MLookup docActionL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 4324 /* M_InOut.DocAction */, @@ -184,21 +184,24 @@ public class WInOutGen extends InOutGen implements ICustomForm, EventListener, V public void validate() { - if (isSelectionActive() && - (m_M_Warehouse_ID == null || (Integer)m_M_Warehouse_ID <= 0)) { - throw new WrongValueException(fWarehouse.getComponent(), Msg.translate(Env.getCtx(), "FillMandatory")); - } + if (isSelectionActive() && getM_Warehouse_ID() <= 0) + { + throw new WrongValueException(fWarehouse.getComponent(), Msg.translate(Env.getCtx(), "FillMandatory")); + } form.saveSelection(); ArrayList selection = getSelection(); if (selection != null && selection.size() > 0 - && isSelectionActive() // on selection tab - && m_M_Warehouse_ID != null) + && isSelectionActive() ) // on selection tab + { form.generate(); + } else + { form.dispose(); + } } /** @@ -209,7 +212,7 @@ public class WInOutGen extends InOutGen implements ICustomForm, EventListener, V { log.info(e.getPropertyName() + "=" + e.getNewValue()); if (e.getPropertyName().equals("M_Warehouse_ID")) - m_M_Warehouse_ID = e.getNewValue(); + setM_Warehouse_ID(e.getNewValue()); if (e.getPropertyName().equals("C_BPartner_ID")) { m_C_BPartner_ID = e.getNewValue();