Commit e153163c authored by Jérome Perrin's avatar Jérome Perrin

Only select organisations/persons that have been used in stock table with...

Only select organisations/persons that have been used in stock table with accounting movements, not all movements. Use security in the query.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29927 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 77f1edaf
......@@ -171,14 +171,18 @@ simulation_state:list</string> </value>
<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
......@@ -194,10 +198,15 @@ WHERE\n
stock.simulation_state = <dtml-sqlvar sequence-item type="string">\n
<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 @@ ORDER BY\n
<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
......@@ -260,10 +273,15 @@ WHERE\n
stock.simulation_state = <dtml-sqlvar sequence-item type="string">\n
<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>
......
1007
\ No newline at end of file
1011
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment