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

fix sort_on syntax


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5997 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9bea963b
...@@ -72,7 +72,7 @@ portal = context.getPortalObject()\n ...@@ -72,7 +72,7 @@ portal = context.getPortalObject()\n
\n \n
period_list = context.getParentValue()\\\n period_list = context.getParentValue()\\\n
.searchFolder( simulation_state = [\'planned\', \'confirmed\', \'delivered\'],\n .searchFolder( simulation_state = [\'planned\', \'confirmed\', \'delivered\'],\n
sort_on = (\'delivery.stop_date\', \'ASC\'))\n sort_on = [(\'delivery.stop_date\', \'ASC\'),] )\n
\n \n
if len(period_list) > 0 :\n if len(period_list) > 0 :\n
last_period = period_list[-1].getObject()\n last_period = period_list[-1].getObject()\n
......
...@@ -81,9 +81,12 @@ stop_date = closing_period.getStopDate()\n ...@@ -81,9 +81,12 @@ stop_date = closing_period.getStopDate()\n
if start_date > stop_date :\n if start_date > stop_date :\n
raise ValidationFailed, N_("Start Date is After Stop Date")\n raise ValidationFailed, N_("Start Date is After Stop Date")\n
\n \n
if start_date.year() != stop_date.year() :\n
raise ValidationFailed, N_("Start Date is not the same year as Stop Date")\n
\n
period_list = closing_period.getParentValue().searchFolder(\n period_list = closing_period.getParentValue().searchFolder(\n
simulation_state = valid_states,\n simulation_state = valid_states,\n
sort_on = \'delivery.start_date\',\n sort_on = [(\'delivery.start_date\', \'asc\')],\n
portal_type = \'Accounting Period\')\n portal_type = \'Accounting Period\')\n
\n \n
for period in period_list :\n for period in period_list :\n
......
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