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

Re-add build_before support.

parent 7cb7f59e
......@@ -320,14 +320,26 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX: re-support build_before\n
<value> <string encoding="cdata"><![CDATA[
from Products.ERP5Type.DateUtils import getClosestDate\n
from DateTime import DateTime\n
\n
# support build_before\n
build_before = kw.pop(\'build_before\', None)\n
if build_before is None:\n
build_before = getClosestDate(target_date=DateTime(), precision=\'month\', before=0)\n
\n
kw[\'movement.start_date\'] = \'< %s\' % build_before\n
\n
if src__==0:\n
movement_list = context.portal_catalog(**kw)\n
return movement_list\n
else:\n
return context.portal_catalog(src__=1, **kw)\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
......
59
\ No newline at end of file
60
\ 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