Commit 32e5aef5 authored by Romain Courteaud's avatar Romain Courteaud

erp5_interaction_drop: expand all validated open order every day

parent dfbd4bc4
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<key> <string>active_sense_method_id</string> </key> <key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_updateOpenOrderSimulation</string> </value> <value> <string>Alarm_updateOpenOrderSimulation</string> </value>
</item> </item>
<item>
<key> <string>automatic_solve</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <value>
...@@ -26,9 +30,7 @@ ...@@ -26,9 +30,7 @@
</item> </item>
<item> <item>
<key> <string>periodicity_day_frequency</string> </key> <key> <string>periodicity_day_frequency</string> </key>
<value> <value> <int>1</int> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>periodicity_hour</string> </key> <key> <string>periodicity_hour</string> </key>
...@@ -44,7 +46,9 @@ ...@@ -44,7 +46,9 @@
</item> </item>
<item> <item>
<key> <string>periodicity_minute_frequency</string> </key> <key> <string>periodicity_minute_frequency</string> </key>
<value> <int>3</int> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>periodicity_month</string> </key> <key> <string>periodicity_month</string> </key>
......
kw = {}
if params is None:
params = {}
last_active_process = context.getLastActiveProcess()
if not params.get('full', False) and last_active_process is not None:
# fetch only objects modified since last alarm run
kw['indexation_timestamp'] = '>= %s' % last_active_process.getStartDate().ISO()
# register active process in order to have "windows" of last indexed objects
context.newActiveProcess().getRelativeUrl()
portal = context.getPortalObject() portal = context.getPortalObject()
kw['portal_type'] = portal.getPortalOpenOrderTypeList()
kw['children_portal_type'] = [ i + " Line" for i in portal.getPortalOpenOrderTypeList()]
portal.portal_catalog.searchAndActivate( portal.portal_catalog.searchAndActivate(
method_id='OpenOrder_updateSimulation', method_id='OpenOrder_updateSimulation',
packet_size=1, portal_type=portal.getPortalOpenOrderTypeList(),
activate_kw={'tag':tag}, validation_state="validated",
**kw activate_kw={'tag':tag}
) )
# make alarm run once at time # make alarm run once at time
......
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