[Characteristics]Filter generic products in AD selectors and combos.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Tue, 25 Jun 2013 13:08:10 +0200
changeset 20939 b79dcb1948bc
parent 20938 95c75650dbda
child 20940 3348ce170fc7
[Characteristics]Filter generic products in AD selectors and combos.
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml
src-db/database/model/views/M_PRODUCT_PRICE_WAREHOUSE_V.xml
src-db/database/model/views/M_PRODUCT_STOCK_V.xml
src-db/database/sourcedata/AD_REF_TABLE.xml
src-db/database/sourcedata/AD_VAL_RULE.xml
src-db/database/sourcedata/OBUISEL_SELECTOR.xml
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Tue Jun 25 10:44:12 2013 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Tue Jun 25 13:08:10 2013 +0200
@@ -127,7 +127,7 @@
 <!--FF808181312DA8D801312DDE869B000C-->  <AD_REFERENCE_ID><![CDATA[FF808181312DA8D801312DDDAA750008]]></AD_REFERENCE_ID>
 <!--FF808181312DA8D801312DDE869B000C-->  <AD_TABLE_ID><![CDATA[208]]></AD_TABLE_ID>
 <!--FF808181312DA8D801312DDE869B000C-->  <AD_COLUMN_ID><![CDATA[1402]]></AD_COLUMN_ID>
-<!--FF808181312DA8D801312DDE869B000C-->  <WHERECLAUSE><![CDATA[e.active='Y']]></WHERECLAUSE>
+<!--FF808181312DA8D801312DDE869B000C-->  <WHERECLAUSE><![CDATA[e.active='Y' AND e.isgeneric='N']]></WHERECLAUSE>
 <!--FF808181312DA8D801312DDE869B000C-->  <FILTER_EXPRESSION><![CDATA[OB.getFilterExpression("org.openbravo.erpCommon.info.RMProductSelectorFilterExpression")]]></FILTER_EXPRESSION>
 <!--FF808181312DA8D801312DDE869B000C-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--FF808181312DA8D801312DDE869B000C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
--- a/src-db/database/model/views/M_PRODUCT_PRICE_WAREHOUSE_V.xml	Tue Jun 25 10:44:12 2013 +0200
+++ b/src-db/database/model/views/M_PRODUCT_PRICE_WAREHOUSE_V.xml	Tue Jun 25 13:08:10 2013 +0200
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_PRODUCT_PRICE_WAREHOUSE_V">
-    <view name="M_PRODUCT_PRICE_WAREHOUSE_V"><![CDATA[SELECT COALESCE(w.m_warehouse_id, '-') || pp.m_productprice_id AS m_product_price_warehouse_v_id, p.ad_client_id, p.ad_org_id, p.isactive, p.updated, p.updatedby, p.created, p.createdby, p.m_product_id, w.m_warehouse_id, pp.m_productprice_id,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 99999 ELSE COALESCE(pwq.qtyonhand - pwq.qtyreserved, 0) END AS qty_available,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 99999 ELSE COALESCE(pwq.qtyonhand, 0) END AS qty_onhand,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 0 ELSE COALESCE(pwq.qtyreserved, 0) END AS qty_reserved,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 0 ELSE COALESCE(pwq.qtyordered, 0) END AS qty_ordered, pp.pricelist, pp.pricestd, pp.pricelimit FROM m_productprice pp LEFT JOIN m_warehouse w ON pp.ad_client_id = w.ad_client_id LEFT JOIN m_product p ON p.m_product_id = pp.m_product_id LEFT JOIN m_product_warehouse_qtys_v pwq ON pwq.m_product_id = pp.m_product_id AND pwq.m_warehouse_id = w.m_warehouse_id]]></view>
+    <view name="M_PRODUCT_PRICE_WAREHOUSE_V"><![CDATA[SELECT COALESCE(w.m_warehouse_id, '-') || pp.m_productprice_id AS m_product_price_warehouse_v_id, p.ad_client_id, p.ad_org_id, p.isactive, p.updated, p.updatedby, p.created, p.createdby, p.m_product_id, w.m_warehouse_id, pp.m_productprice_id,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 99999 ELSE COALESCE(pwq.qtyonhand - pwq.qtyreserved, 0) END AS qty_available,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 99999 ELSE COALESCE(pwq.qtyonhand, 0) END AS qty_onhand,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 0 ELSE COALESCE(pwq.qtyreserved, 0) END AS qty_reserved,  CASE WHEN p.producttype <> 'I' OR p.isstocked = 'N' THEN 0 ELSE COALESCE(pwq.qtyordered, 0) END AS qty_ordered, pp.pricelist, pp.pricestd, pp.pricelimit FROM m_productprice pp LEFT JOIN m_warehouse w ON pp.ad_client_id = w.ad_client_id LEFT JOIN m_product p ON p.m_product_id = pp.m_product_id LEFT JOIN m_product_warehouse_qtys_v pwq ON pwq.m_product_id = pp.m_product_id AND pwq.m_warehouse_id = w.m_warehouse_id WHERE p.isgeneric = 'N']]></view>
   </database>
--- a/src-db/database/model/views/M_PRODUCT_STOCK_V.xml	Tue Jun 25 10:44:12 2013 +0200
+++ b/src-db/database/model/views/M_PRODUCT_STOCK_V.xml	Tue Jun 25 13:08:10 2013 +0200
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_PRODUCT_STOCK_V">
-    <view name="M_PRODUCT_STOCK_V"><![CDATA[SELECT p.m_product_id || sd.m_storage_detail_id AS m_product_stock_v_id, l.ad_client_id, l.ad_org_id, l.isactive, sd.created, sd.createdby, sd.updated, sd.updatedby, sd.m_product_id, sd.qtyonhand, sd.qtyorderonhand, sd.preqtyonhand, sd.preqtyorderonhand, sd.c_uom_id, sd.m_product_uom_id, sd.m_attributesetinstance_id, sd.m_locator_id, 'Y' AS stocked FROM m_storage_detail sd JOIN m_locator l ON sd.m_locator_id = l.m_locator_id JOIN m_product p ON sd.m_product_id = p.m_product_id AND p.isactive = 'Y' WHERE sd.qtyonhand <> 0 OR COALESCE(sd.qtyorderonhand, 0) <> 0 UNION ALL  SELECT p.m_product_id AS m_product_stock_v_id, p.ad_client_id, p.ad_org_id, p.isactive, p.created, p.createdby, p.updated, p.updatedby, p.m_product_id, 0 AS qtyonhand, NULL AS qtyorderonhand, 0 AS preqtyonhand, NULL AS preqtyorderonhand, p.c_uom_id, NULL AS m_product_uom_id,  CASE p.attrsetvaluetype WHEN 'D' THEN p.m_attributesetinstance_id ELSE NULL END AS m_attributesetinstance_id, NULL AS m_locator_id, 'N' AS stocked FROM m_product p]]></view>
+    <view name="M_PRODUCT_STOCK_V"><![CDATA[SELECT p.m_product_id || sd.m_storage_detail_id AS m_product_stock_v_id, l.ad_client_id, l.ad_org_id, l.isactive, sd.created, sd.createdby, sd.updated, sd.updatedby, sd.m_product_id, sd.qtyonhand, sd.qtyorderonhand, sd.preqtyonhand, sd.preqtyorderonhand, sd.c_uom_id, sd.m_product_uom_id, sd.m_attributesetinstance_id, sd.m_locator_id, 'Y' AS stocked FROM m_storage_detail sd JOIN m_locator l ON sd.m_locator_id = l.m_locator_id JOIN m_product p ON sd.m_product_id = p.m_product_id AND p.isactive = 'Y' WHERE sd.qtyonhand <> 0 OR COALESCE(sd.qtyorderonhand, 0) <> 0 UNION ALL  SELECT p.m_product_id AS m_product_stock_v_id, p.ad_client_id, p.ad_org_id, p.isactive, p.created, p.createdby, p.updated, p.updatedby, p.m_product_id, 0 AS qtyonhand, NULL AS qtyorderonhand, 0 AS preqtyonhand, NULL AS preqtyorderonhand, p.c_uom_id, NULL AS m_product_uom_id,  CASE p.attrsetvaluetype WHEN 'D' THEN p.m_attributesetinstance_id ELSE NULL END AS m_attributesetinstance_id, NULL AS m_locator_id, 'N' AS stocked FROM m_product p WHERE p.isgeneric = 'N']]></view>
   </database>
--- a/src-db/database/sourcedata/AD_REF_TABLE.xml	Tue Jun 25 10:44:12 2013 +0200
+++ b/src-db/database/sourcedata/AD_REF_TABLE.xml	Tue Jun 25 13:08:10 2013 +0200
@@ -394,6 +394,7 @@
 <!--162-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--162-->  <WHERECLAUSE><![CDATA[M_Product.IsSummary='N']]></WHERECLAUSE>
 <!--162-->  <ORDERBYCLAUSE><![CDATA[M_Product.Value]]></ORDERBYCLAUSE>
+<!--162-->  <HQLWHERECLAUSE><![CDATA[isSummary= false AND isGeneric = false]]></HQLWHERECLAUSE>
 <!--162--></AD_REF_TABLE>
 
 <!--163--><AD_REF_TABLE>
@@ -456,6 +457,7 @@
 <!--171-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--171-->  <WHERECLAUSE><![CDATA[M_Product.IsStocked='Y']]></WHERECLAUSE>
 <!--171-->  <ORDERBYCLAUSE><![CDATA[M_Product.Value]]></ORDERBYCLAUSE>
+<!--171-->  <HQLWHERECLAUSE><![CDATA[IsStocked=true AND isGeneric = false]]></HQLWHERECLAUSE>
 <!--171--></AD_REF_TABLE>
 
 <!--172--><AD_REF_TABLE>
@@ -647,6 +649,7 @@
 <!--211-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--211-->  <WHERECLAUSE><![CDATA[M_Product.IsBOM='Y' AND M_Product.IsStocked='Y']]></WHERECLAUSE>
 <!--211-->  <ORDERBYCLAUSE><![CDATA[M_Product.Value]]></ORDERBYCLAUSE>
+<!--211-->  <HQLWHERECLAUSE><![CDATA[isBOM=true AND IsStocked=true AND isGeneric=false]]></HQLWHERECLAUSE>
 <!--211--></AD_REF_TABLE>
 
 <!--223--><AD_REF_TABLE>
@@ -1128,6 +1131,7 @@
 <!--1F603F334B704F53928B8DB908611657-->  <AD_KEY><![CDATA[1402]]></AD_KEY>
 <!--1F603F334B704F53928B8DB908611657-->  <AD_DISPLAY><![CDATA[1410]]></AD_DISPLAY>
 <!--1F603F334B704F53928B8DB908611657-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--1F603F334B704F53928B8DB908611657-->  <HQLWHERECLAUSE><![CDATA[isGeneric = false]]></HQLWHERECLAUSE>
 <!--1F603F334B704F53928B8DB908611657--></AD_REF_TABLE>
 
 <!--22F546D49D3A48E1B2B4F50446A8DE58--><AD_REF_TABLE>
--- a/src-db/database/sourcedata/AD_VAL_RULE.xml	Tue Jun 25 10:44:12 2013 +0200
+++ b/src-db/database/sourcedata/AD_VAL_RULE.xml	Tue Jun 25 13:08:10 2013 +0200
@@ -927,7 +927,7 @@
 <!--800014-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--800014-->  <NAME><![CDATA[S_Expense product type]]></NAME>
 <!--800014-->  <TYPE><![CDATA[S]]></TYPE>
-<!--800014-->  <CODE><![CDATA[PRODUCTTYPE = (CASE WHEN @ISTIMEREPORT@ IS NULL THEN 'E' WHEN @ISTIMEREPORT@='Y' THEN 'S' ELSE 'E' END)]]></CODE>
+<!--800014-->  <CODE><![CDATA[PRODUCTTYPE = (CASE WHEN @ISTIMEREPORT@ IS NULL THEN 'E' WHEN @ISTIMEREPORT@='Y' THEN 'S' ELSE 'E' END) AND isgeneric = 'N']]></CODE>
 <!--800014-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--800014--></AD_VAL_RULE>
 
--- a/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Tue Jun 25 10:44:12 2013 +0200
+++ b/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Tue Jun 25 13:08:10 2013 +0200
@@ -11,6 +11,7 @@
 <!--00A9109E64DD404CA95719D20A9BBBF0-->  <AD_REFERENCE_ID><![CDATA[84BD487714B04B838A8D562A30E8792C]]></AD_REFERENCE_ID>
 <!--00A9109E64DD404CA95719D20A9BBBF0-->  <AD_TABLE_ID><![CDATA[208]]></AD_TABLE_ID>
 <!--00A9109E64DD404CA95719D20A9BBBF0-->  <AD_COLUMN_ID><![CDATA[1402]]></AD_COLUMN_ID>
+<!--00A9109E64DD404CA95719D20A9BBBF0-->  <WHERECLAUSE><![CDATA[e.isgeneric='N']]></WHERECLAUSE>
 <!--00A9109E64DD404CA95719D20A9BBBF0-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--00A9109E64DD404CA95719D20A9BBBF0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--00A9109E64DD404CA95719D20A9BBBF0-->  <VALUEFIELD_ID><![CDATA[8283EB51255943B3B92B421AE14E8661]]></VALUEFIELD_ID>
@@ -436,7 +437,8 @@
 join pp.priceListVersion plv
 join plv.priceList pl
 left join pl.currency c
-where @additional_filters@]]></HQL>
+where p.isgeneric = 'N'
+  and @additional_filters@]]></HQL>
 <!--EB3C41F0973A4EDA91E475833792A6D4-->  <ENTITY_ALIAS><![CDATA[pp]]></ENTITY_ALIAS>
 <!--EB3C41F0973A4EDA91E475833792A6D4-->  <CUSTOM_QUERY><![CDATA[Y]]></CUSTOM_QUERY>
 <!--EB3C41F0973A4EDA91E475833792A6D4--></OBUISEL_SELECTOR>