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

support the case where there's no date found

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26115 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d656ce78
...@@ -96,13 +96,16 @@ if from_date is None:\n ...@@ -96,13 +96,16 @@ if from_date is None:\n
q = NegatedQuery(Query(**kw))\n q = NegatedQuery(Query(**kw))\n
select_expression = "MIN(delivery.start_date)"\n select_expression = "MIN(delivery.start_date)"\n
group_by = "delivery.start_date"\n group_by = "delivery.start_date"\n
from_date = DateTime(context.portal_catalog(\n from_date = DateTime()\n
result_list = context.portal_catalog(\n
select_expression=select_expression,\n select_expression=select_expression,\n
group_by_expression=group_by,\n group_by_expression=group_by,\n
simulation_state=simulation_state,\n simulation_state=simulation_state,\n
portal_type=doc_portal_type,\n portal_type=doc_portal_type,\n
query=q,\n query=q,\n
limit=1)[0][2])\n limit=1)\n
if result_list:\n
from_date = DateTime(result_list[0][2])\n
\n \n
\n \n
# get period list between given date\n # get period list between given date\n
...@@ -219,6 +222,7 @@ return result\n ...@@ -219,6 +222,7 @@ return result\n
<string>_apply_</string> <string>_apply_</string>
<string>q</string> <string>q</string>
<string>select_expression</string> <string>select_expression</string>
<string>result_list</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>interval_list_dict</string> <string>interval_list_dict</string>
<string>interval_list</string> <string>interval_list</string>
......
622 623
\ 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