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

Re-add build_before support.

parent 6db4ed0d
...@@ -320,14 +320,26 @@ ...@@ -320,14 +320,26 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <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 \n
if src__==0:\n if src__==0:\n
movement_list = context.portal_catalog(**kw)\n movement_list = context.portal_catalog(**kw)\n
return movement_list\n return movement_list\n
else:\n else:\n
return context.portal_catalog(src__=1, **kw)\n return context.portal_catalog(src__=1, **kw)\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
......
59 60
\ 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