Commit adfb1ae3 authored by Vincent Pelletier's avatar Vincent Pelletier

Restrict last counter day lookup to current year (references must restart at 1 each year).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24999 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0966b1ba
......@@ -120,8 +120,10 @@ if listbox is not None:\n
\n
\n
# Set a reference\n
first_day_of_year = DateTime(now.year(), 1, 1)\n
counter_date_list = [x.getObject() for x in context.portal_catalog(\n
portal_type=\'Counter Date\',site_uid=site_uid,\n
start_date={\'type\': \'date\', \'query\': first_day_of_year, \'range\': \'nlt\'},\n
sort_on=[(\'start_date\',\'descending\')],limit=1,\n
simulation_state=(\'open\',\'closed\'))]\n
previous_reference = None\n
......@@ -207,6 +209,7 @@ counter_date.setReference(reference)\n
<string>check_date_is_today</string>
<string>line</string>
<string>counter</string>
<string>first_day_of_year</string>
<string>previous_reference</string>
<string>previous_counter_date</string>
<string>int</string>
......
475
\ No newline at end of file
476
\ 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