From 71b4f04a6200f2aba37098142f31624c7e9d5433 Mon Sep 17 00:00:00 2001 From: "Hesham S. Ahmed" Date: Mon, 16 Jul 2012 22:55:06 +0300 Subject: [PATCH] IDEMPIERE-339 - Improve Info Product Window, fix exception when logging in with no warehouse (transplanted from 326acd1094974d6d00a5571fddfa8bd805dcf16a) --- .../src/org/compiere/apps/search/InfoProduct.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java index 5974a20a1f..5bf28a15a3 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/InfoProduct.java @@ -543,10 +543,15 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener setPriceListVersion (M_PriceList_Version_ID); // Create Grid + String orderBy = null; StringBuffer where = new StringBuffer(); where.append("p.IsActive='Y'"); if (M_Warehouse_ID != 0) + { where.append(" AND p.IsSummary='N'"); + orderBy = "QtyAvailable DESC"; + } + // dynamic Where Clause if (p_whereClause != null && p_whereClause.length() > 0) where.append(" AND ") // replace fully qualified name with alias @@ -555,7 +560,7 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener prepareTable(getProductLayout(), s_productFrom, where.toString(), - "QtyAvailable DESC"); + orderBy); p_table.setShowTotals(false); // pickWarehouse.addActionListener(this);