Commit cd58d5d7 authored by Łukasz Nowak's avatar Łukasz Nowak

Allow to pass and transmit parameters.

parent 19037c78
......@@ -50,15 +50,26 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.portal_catalog.searchAndActivate(\n
method_id=\'OpenSaleOrderLine_setStopDateForward\',\n
<value> <string>stop_date = None\n
if params is not None:\n
stop_date = params.get(\'stop_date\')\n
from DateTime import DateTime\n
from Products.ERP5Type.DateUtils import getClosestDate, addToDate\n
\n
if stop_date is None:\n
# generate expected next month\n
stop_date = addToDate(getClosestDate(target_date=DateTime(), precision=\'month\', before=1), month=2)\n
\n
context.portal_catalog.searchAndActivate(\n
method_id=\'OpenSaleOrderLine_updateStopDate\',\n
activate_kw={\'tag\':tag},\n
method_kw={\'stop_date\': stop_date},\n
portal_type=\'Open Sale Order Line\')\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>tag, fixit</string> </value>
<value> <string>tag, fixit, params</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -52,12 +52,6 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
from DateTime import DateTime\n
from Products.ERP5Type.DateUtils import getClosestDate, addToDate\n
\n
# generate expected next month\n
stop_date = addToDate(getClosestDate(target_date=DateTime(), precision=\'month\', before=1), month=2)\n
\n
if context.getStopDate() < stop_date:\n
context.setStopDate(stop_date)\n
......@@ -66,11 +60,11 @@ if context.getStopDate() < stop_date:\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>stop_date</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OpenSaleOrderLine_setStopDateForward</string> </value>
<value> <string>OpenSaleOrderLine_updateStopDate</string> </value>
</item>
</dictionary>
</pickle>
......
511
\ No newline at end of file
512
\ 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