Commit a5844576 authored by Yusei Tahara's avatar Yusei Tahara

more a bit optimization.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19548 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ff2f56b3
...@@ -492,7 +492,7 @@ ...@@ -492,7 +492,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:(cell.section_mark==\'source\' and cell.getStartDate()) or cell.getStopDate()</string> </value> <value> <string>python:(cell.section_mark==\'source\' and getattr(cell.getObject(), \'start_date\', None)) or getattr(cell.getObject(), \'stop_date\', None)</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -636,7 +636,11 @@ destination_section_where_expression</string> </value> ...@@ -636,7 +636,11 @@ destination_section_where_expression</string> </value>
SELECT COUNT(DISTINCT uid) AS count FROM (\n SELECT COUNT(DISTINCT uid) AS count FROM (\n
<dtml-else>\n <dtml-else>\n
SELECT catalog.*,\n SELECT catalog.*,\n
( SELECT path FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_path,\n <dtml-let portal="portal_url.getPortalObject()"\n
substring_position="len(\'/\'.join(portal.getPhysicalPath()))+1"\n
portal_absolute_url="portal.absolute_url(relative=1)">\n
( SELECT CONCAT(<dtml-sqlvar portal_absolute_url type=string>, SUBSTRING(path, <dtml-var substring_position>)) FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_url,\n
</dtml-let>\n
( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n ( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n
( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
...@@ -1293,7 +1297,11 @@ UNION\n ...@@ -1293,7 +1297,11 @@ UNION\n
SELECT COUNT(DISTINCT uid) AS count FROM (\n SELECT COUNT(DISTINCT uid) AS count FROM (\n
<dtml-else>\n <dtml-else>\n
SELECT catalog.*,\n SELECT catalog.*,\n
( SELECT path FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_path,\n <dtml-let portal="portal_url.getPortalObject()"\n
substring_position="len(\'/\'.join(portal.getPhysicalPath()))+1"\n
portal_absolute_url="portal.absolute_url(relative=1)">\n
( SELECT CONCAT(<dtml-sqlvar portal_absolute_url type=string>, SUBSTRING(path, <dtml-var substring_position>)) FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_url,\n
</dtml-let>\n
( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n ( SELECT title FROM catalog as mirror_catalog WHERE mirror_catalog.uid=catalog.delivery_mirror_section_uid ) AS delivery_mirror_section_title,\n
( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n ( SELECT IFNULL(SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price > 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS debit,\n
( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n ( SELECT IFNULL(-SUM(stock.total_price), 0) FROM stock, catalog AS child WHERE child.uid = stock.uid AND child.parent_uid = catalog.uid AND stock.section_uid=catalog.category_uid AND stock.total_price < 0 AND <dtml-sqltest accounting_movement_list type=string column=child.portal_type op=eq multiple>) AS credit\n
......
...@@ -69,12 +69,7 @@ ...@@ -69,12 +69,7 @@
view_name = \'Entity_viewAccountingTransactionList?reset:int=1\'\n view_name = \'Entity_viewAccountingTransactionList?reset:int=1\'\n
\n \n
try:\n try:\n
delivery_mirror_section_path = context.delivery_mirror_section_path\n return \'/%s/%s\' % (context.delivery_mirror_section_url, view_name)\n
if delivery_mirror_section_path is not None:\n
relative_path = \'/\'.join(delivery_mirror_section_path.split(\'/\')[2:])\n
return \'%s/%s/%s\' % (context.portal_url(), relative_path, view_name)\n
else:\n
return None\n
except AttributeError:\n except AttributeError:\n
pass\n pass\n
\n \n
...@@ -139,11 +134,8 @@ if mirror_section is not None:\n ...@@ -139,11 +134,8 @@ if mirror_section is not None:\n
<string>view_name</string> <string>view_name</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>delivery_mirror_section_path</string>
<string>None</string>
<string>_getitem_</string>
<string>relative_path</string>
<string>AttributeError</string> <string>AttributeError</string>
<string>None</string>
<string>transaction</string> <string>transaction</string>
<string>mirror_section</string> <string>mirror_section</string>
</tuple> </tuple>
......
623 624
\ No newline at end of file \ 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