details:   https://code.openbravo.com/erp/devel/pi/rev/a28822293fdd
changeset: 31528:a28822293fdd
user:      Victor Martinez Romanos <victor.martinez <at> openbravo.com>
date:      Thu Feb 16 12:22:58 2017 +0100
summary:   Fixed bug 35263: Organization filter in Best Seller widget

The Best Seller widget didn't have organization filter thus showing records 
belonging to organizations where the role doesn't have access to.

The fix introduces a new parameter to get the readable orgs, and the HQL query 
has been adapated to use it.

diffstat:

 
modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
 |   1 +
 
modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
  |  26 ++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diffs (47 lines):

diff -r 0e3c102ec91e -r a28822293fdd 
modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
--- 
a/modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
    Wed Feb 15 14:13:23 2017 +0100
+++ 
b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
    Thu Feb 16 12:22:58 2017 +0100
@@ -51,6 +51,7 @@
 and @optional_filters@
 and ol.client.id = :client
 and ol.product.name like :pname
+and ol.organization.id in (:organizationList)
 group by product.name, product.uOM.name, product.id, product.uOM.id 
 order by sum(orderedQuantity) desc]]></HQL>
 <!--CFDF8EE593F04CFE9709F5AD19A3A573-->  <TYPE><![CDATA[HQL]]></TYPE>
diff -r 0e3c102ec91e -r a28822293fdd 
modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
--- 
a/modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
     Wed Feb 15 14:13:23 2017 +0100
+++ 
b/modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
     Thu Feb 16 12:22:58 2017 +0100
@@ -559,6 +559,32 @@
 <!--D1BE41F04FD14C3A9E6980369BC97E87-->  
<EM_OBKMO_WIDGET_CLASS_ID><![CDATA[5291D3D3B07B4CFC87928071377740E8]]></EM_OBKMO_WIDGET_CLASS_ID>
 <!--D1BE41F04FD14C3A9E6980369BC97E87--></OBUIAPP_PARAMETER>
 
+<!--D4B555A658964D3C87B4D06F828832FA--><OBUIAPP_PARAMETER>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<OBUIAPP_PARAMETER_ID><![CDATA[D4B555A658964D3C87B4D06F828832FA]]></OBUIAPP_PARAMETER_ID>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D4B555A658964D3C87B4D06F828832FA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D4B555A658964D3C87B4D06F828832FA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<AD_MODULE_ID><![CDATA[FF8080812D842086012D844F3CC0003E]]></AD_MODULE_ID>
+<!--D4B555A658964D3C87B4D06F828832FA-->  <NAME><![CDATA[Organization 
List]]></NAME>
+<!--D4B555A658964D3C87B4D06F828832FA-->  <DESCRIPTION><![CDATA[List of 
Organizations this Role can access]]></DESCRIPTION>
+<!--D4B555A658964D3C87B4D06F828832FA-->  <HELP><![CDATA[The Organization List 
indicates the Organizations (by organization id) that this Role can access.  
Multiple Organizations are delimited by a comma ','.]]></HELP>
+<!--D4B555A658964D3C87B4D06F828832FA-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<COLUMNNAME><![CDATA[organizationList]]></COLUMNNAME>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<AD_ELEMENT_ID><![CDATA[478]]></AD_ELEMENT_ID>
+<!--D4B555A658964D3C87B4D06F828832FA-->  <ISFIXED><![CDATA[Y]]></ISFIXED>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<FIXEDVALUE><![CDATA[OB.getContext().getReadableOrganizations()]]></FIXEDVALUE>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<EVALUATEFIXEDVALUE><![CDATA[Y]]></EVALUATEFIXEDVALUE>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<STARTINNEWLINE><![CDATA[N]]></STARTINNEWLINE>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--D4B555A658964D3C87B4D06F828832FA-->  
<EM_OBKMO_WIDGET_CLASS_ID><![CDATA[CD1B06C4ED974B5F905A5A01B097DF4E]]></EM_OBKMO_WIDGET_CLASS_ID>
+<!--D4B555A658964D3C87B4D06F828832FA--></OBUIAPP_PARAMETER>
+
 <!--D57E85EA046B475C94EEE74A9CF67C78--><OBUIAPP_PARAMETER>
 <!--D57E85EA046B475C94EEE74A9CF67C78-->  
<OBUIAPP_PARAMETER_ID><![CDATA[D57E85EA046B475C94EEE74A9CF67C78]]></OBUIAPP_PARAMETER_ID>
 <!--D57E85EA046B475C94EEE74A9CF67C78-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to