From b58546521f85a2adb5be029eb27d7318bff2eeeb Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Tue, 17 Dec 2013 10:44:06 +0800 Subject: [PATCH] 1003572 Problem with Locator field on "Import Inventory" process. Fixed wrong checking for "first locator element is empty". --- .../org/adempiere/webui/window/WLocatorDialog.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java index b7db1d0f50..e2a5ea540f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WLocatorDialog.java @@ -304,8 +304,18 @@ public class WLocatorDialog extends Window implements EventListener if (log.isLoggable(Level.FINE)) log.fine(m_mLocator.toString()); - if (m_mLocator.getSize()==0 || (m_mLocator.getSize()==1 && m_mLocator.get(m_mLocator.getElementAt(0))==null)) - throw new AdempiereUserError(Msg.getMsg(Env.getCtx(), "DRP-001", false)); + if (m_mLocator.getSize()==0) + { + throw new AdempiereUserError(Msg.getMsg(Env.getCtx(), "DRP-001", false)); + } + else if (m_mLocator.getSize()==1) + { + MLocator locator = (MLocator) m_mLocator.getElementAt(0); + if (locator == null || locator.getM_Locator_ID() <= 0) + { + throw new AdempiereUserError(Msg.getMsg(Env.getCtx(), "DRP-001", false)); + } + } for (int i = 0; i < m_mLocator.getSize(); i++) {