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

AccountingPeriod_init:

* take into account the new workflow state name for the Accounting Period workflow.
* init stop date to 31 of december by default

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17312 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3599d90c
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -68,21 +65,18 @@ ...@@ -68,21 +65,18 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>from DateTime import DateTime\n
portal = context.getPortalObject()\n
\n \n
period_list = context.getParentValue()\\\n period_list = context.getParentValue().searchFolder(\n
.searchFolder( simulation_state = [\'planned\', \'confirmed\', \'delivered\'],\n simulation_state=[\'started\', \'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 period_list:\n
last_period = period_list[-1].getObject()\n last_period = period_list[-1].getObject()\n
context.setStartDate(last_period.getStopDate() + 1)\n new_date = last_period.getStopDate() + 1\n
context.setStopDate(None) # XXX doesn\'t work\n context.setStartDate(new_date)\n
context.setStopDate(DateTime(new_date.year(), 12, 31))\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -126,14 +120,13 @@ if len(period_list) > 0 :\n ...@@ -126,14 +120,13 @@ if len(period_list) > 0 :\n
<tuple> <tuple>
<string>args</string> <string>args</string>
<string>kw</string> <string>kw</string>
<string>DateTime</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal</string>
<string>period_list</string> <string>period_list</string>
<string>len</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>last_period</string> <string>last_period</string>
<string>None</string> <string>new_date</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
460 461
\ 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