Fixes issue 21416: Is impossible to execute Information/product
authorJavier Etxarri <javier.echarri@openbravo.com>
Wed, 22 Aug 2012 13:32:59 +0200
changeset 9888 6343ecfcca6f
parent 9887 1506f11efe15
child 9889 2158abf064cf
Fixes issue 21416: Is impossible to execute Information/product
src/org/openbravo/erpCommon/info/PriceListVersionCombo_data.xsql
src/org/openbravo/erpCommon/info/Product.java
--- a/src/org/openbravo/erpCommon/info/PriceListVersionCombo_data.xsql	Thu Aug 09 18:45:57 2012 +0000
+++ b/src/org/openbravo/erpCommon/info/PriceListVersionCombo_data.xsql	Wed Aug 22 13:32:59 2012 +0200
@@ -34,15 +34,14 @@
         AND p.C_Currency_ID=c.C_Currency_ID 
         AND M_PriceList_Version.IsActive='Y' 
         AND M_PriceList_Version.AD_Client_ID IN ('1') 
-        AND p.ad_org_id IN 
-        AND p.issopricelist = ?
+        AND 1=1 
+        AND 2=2
         ORDER BY M_PriceList_Version.Name
       ]]></Sql>
       <Parameter name="priceList" optional="true" after="AND M_PriceList_Version.IsActive='Y' " text="AND EXISTS (SELECT * FROM M_PriceList xp WHERE xp.M_PriceList_ID= ? AND p.C_Currency_ID=xp.C_Currency_ID)"/>
       <Parameter name="adUserClient" type="replace" optional="true" after="M_PriceList_Version.AD_Client_ID IN (" text="'1'"/>
-      <Parameter name="organizations" optional="true" after="AND p.ad_org_id IN " text="(select ad_org_id from AD_ORG O where ad_isorgincluded(?, o.ad_org_id, ?) != -1)"/>
-      <Parameter name="client_id"/>
-      <Parameter name="isSales"/> 
+      <Parameter name="organizations" optional="true" after="AND 1=1" text=" AND p.ad_org_id IN (select ad_org_id from AD_ORG O where ad_isorgincluded(?, o.ad_org_id, M_PriceList_Version.AD_Client_ID) != -1)"/>
+      <Parameter name="isSales" optional="true" after="AND 2=2" text=" AND p.issopricelist = ?"/> 
    </SqlMethod>
 
    <SqlMethod name="selectActual" type="preparedStatement" return="multiple">
--- a/src/org/openbravo/erpCommon/info/Product.java	Thu Aug 09 18:45:57 2012 +0000
+++ b/src/org/openbravo/erpCommon/info/Product.java	Wed Aug 22 13:32:59 2012 +0200
@@ -263,11 +263,12 @@
     xmlDocument.setParameter("grid_SortDirs", "ASC");
     xmlDocument.setParameter("grid_Default", "0");
 
-    xmlDocument.setData("structure1", WarehouseComboData.select(this, vars.getRole(), vars
-        .getClient()));
+    xmlDocument.setData("structure1",
+        WarehouseComboData.select(this, vars.getRole(), vars.getClient()));
 
     xmlDocument.setData("structure2", PriceListVersionComboData.select(this, strPriceList, Utility
-        .getContext(this, vars, "#User_Client", "Product"), strOrg, vars.getClient(), isSales));
+        .getContext(this, vars, "#User_Client", "Product"), "".equals(strOrg) ? null : strOrg, ""
+        .equals(isSales) ? null : isSales));
 
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();