Commit d662fdd7 authored by Romain Courteaud's avatar Romain Courteaud

erp5_interaction_drop: expand all validated open order every day

parent 0b85e4ca
......@@ -10,6 +10,10 @@
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_updateOpenOrderSimulation</string> </value>
</item>
<item>
<key> <string>automatic_solve</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
......@@ -26,9 +30,7 @@
</item>
<item>
<key> <string>periodicity_day_frequency</string> </key>
<value>
<none/>
</value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
......@@ -44,7 +46,9 @@
</item>
<item>
<key> <string>periodicity_minute_frequency</string> </key>
<value> <int>3</int> </value>
<value>
<none/>
</value>
</item>
<item>
<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()
kw['portal_type'] = portal.getPortalOpenOrderTypeList()
kw['children_portal_type'] = [ i + " Line" for i in portal.getPortalOpenOrderTypeList()]
portal.portal_catalog.searchAndActivate(
method_id='OpenOrder_updateSimulation',
packet_size=1,
activate_kw={'tag':tag},
**kw
portal_type=portal.getPortalOpenOrderTypeList(),
validation_state="validated",
activate_kw={'tag':tag}
)
# 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