[Erp5-report] r29927 - in /erp5/trunk/bt5/erp5_accounting: SkinTemplateItem/portal_skins/er...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 22 15:04:04 CEST 2009


Author: jerome
Date: Thu Oct 22 15:03:59 2009
New Revision: 29927

URL: http://svn.erp5.org?rev=29927&view=rev
Log:
Only select organisations/persons that have been used in stock table with accounting movements, not all movements. Use security in the query.

Modified:
    erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zDistinctSectionList.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zDistinctSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zDistinctSectionList.xml?rev=29927&r1=29926&r2=29927&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zDistinctSectionList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_zDistinctSectionList.xml [utf8] Thu Oct 22 15:03:59 2009
@@ -171,14 +171,18 @@
             <key> <string>src</string> </key>
             <value> <string encoding="cdata"><![CDATA[
 
+<dtml-let query="portal_catalog.buildSQLQuery(query=portal_catalog.getSecurityQuery())">\n
 SELECT DISTINCT\n
-  catalog.uid,\n
-  catalog.path,\n
   catalog.relative_url,\n
   catalog.title,\n
   catalog.portal_type,\n
   catalog.validation_state\n
 FROM\n
+  <dtml-in prefix="table" expr="query[\'from_table_list\']">\n
+   <dtml-if "table_key not in (\'stock\', \'catalog\')">\n
+     <dtml-var table_item> AS <dtml-var table_key>,\n
+   </dtml-if>\n
+  </dtml-in>\n
   catalog,\n
   stock\n
 WHERE\n
@@ -195,9 +199,14 @@
                 <dtml-unless sequence-end>OR </dtml-unless>\n
   </dtml-in> )\n
 </dtml-if>\n
+  AND stock.portal_type in ( <dtml-in getPortalAccountingMovementTypeList><dtml-sqlvar\n
+    sequence-item type="string"><dtml-unless sequence-end>, </dtml-unless></dtml-in> )\n
+<dtml-if "query[\'where_expression\']">\n
+  AND <dtml-var "query[\'where_expression\']">\n
+</dtml-if>\n
 ORDER BY\n
   catalog.portal_type, catalog.title\n
-
+</dtml-let>
 
 ]]></string> </value>
         </item>
@@ -237,14 +246,18 @@
                         <key> <string>raw</string> </key>
                         <value> <string encoding="cdata"><![CDATA[
 
+<dtml-let query="portal_catalog.buildSQLQuery(query=portal_catalog.getSecurityQuery())">\n
 SELECT DISTINCT\n
-  catalog.uid,\n
-  catalog.path,\n
   catalog.relative_url,\n
   catalog.title,\n
   catalog.portal_type,\n
   catalog.validation_state\n
 FROM\n
+  <dtml-in prefix="table" expr="query[\'from_table_list\']">\n
+   <dtml-if "table_key not in (\'stock\', \'catalog\')">\n
+     <dtml-var table_item> AS <dtml-var table_key>,\n
+   </dtml-if>\n
+  </dtml-in>\n
   catalog,\n
   stock\n
 WHERE\n
@@ -261,9 +274,14 @@
                 <dtml-unless sequence-end>OR </dtml-unless>\n
   </dtml-in> )\n
 </dtml-if>\n
+  AND stock.portal_type in ( <dtml-in getPortalAccountingMovementTypeList><dtml-sqlvar\n
+    sequence-item type="string"><dtml-unless sequence-end>, </dtml-unless></dtml-in> )\n
+<dtml-if "query[\'where_expression\']">\n
+  AND <dtml-var "query[\'where_expression\']">\n
+</dtml-if>\n
 ORDER BY\n
   catalog.portal_type, catalog.title\n
-
+</dtml-let>
 
 ]]></string> </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=29927&r1=29926&r2=29927&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Thu Oct 22 15:03:59 2009
@@ -1,1 +1,1 @@
-1007
+1011




More information about the Erp5-report mailing list