[Erp5-report] r43782 seb - in /erp5/trunk/bt5/erp5_project: SkinTemplateItem/portal_skins/e...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Feb 25 18:24:58 CET 2011


Author: seb
Date: Fri Feb 25 18:24:58 2011
New Revision: 43782

URL: http://svn.erp5.org?rev=43782&view=rev
Log:
Do not parse all tasks reports if search of workers does not match anything

Modified:
    erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_getMonthlyReportSectionList.xml
    erp5/trunk/bt5/erp5_project/bt/revision

Modified: erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_getMonthlyReportSectionList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_getMonthlyReportSectionList.xml?rev=43782&r1=43781&r2=43782&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_getMonthlyReportSectionList.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_getMonthlyReportSectionList.xml [utf8] Fri Feb 25 18:24:58 2011
@@ -72,8 +72,10 @@ if context.getPortalType() == \'Project\
      relative_url=\'%s/%%\' % context.getRelativeUrl())] + [context.getUid()]\n
 worker_title_list = request.get(\'worker_title_list\')\n
 if worker_title_list is not None and len(worker_title_list):\n
-  inventory_kw[\'node_uid\'] = [x.uid for x in portal.portal_catalog(\n
+  worker_uid_list = [x.uid for x in portal.portal_catalog(\n
                               portal_type=\'Person\',title=worker_title_list)]\n
+  if len(worker_uid_list):\n
+    inventory_kw[\'node_uid\'] = worker_uid_list\n
 \n
 from_date = request.get(\'from_date\', None)\n
 if from_date is None:\n
@@ -90,7 +92,12 @@ full_date_string = "%s-%s -> %s-%s" % (f
 \n
 \n
 # We will use inventory API in order to find all quantities\n
-result_list = portal.portal_simulation.getInventoryList(\n
+result_list = []\n
+# Launch report only if we have restrictive parameters in inventory_kw,\n
+# otherwise getInventoryList will take all task reports and this will\n
+# kill the current node\n
+if len(inventory_kw):\n
+  result_list = portal.portal_simulation.getInventoryList(\n
                   simulation_state = simulation_state,\n
                   portal_type=\'Task Report Line\',\n
                   from_date=from_date,\n

Modified: erp5/trunk/bt5/erp5_project/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_project/bt/revision?rev=43782&r1=43781&r2=43782&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_project/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_project/bt/revision [utf8] Fri Feb 25 18:24:58 2011
@@ -1 +1 @@
-793
\ No newline at end of file
+794
\ No newline at end of file



More information about the Erp5-report mailing list