Commit b55ecd93 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_crm: activate searchAndActivate

Because the number of objects to be retrieved can be too big, or because the query can be complex (depending on the definition of the domain), and because searchAndActivate add a sort on uid (even if it's a primary key, this sort is amplified by the 2 previous reasons), searchAndActivate should be activated to avoid timeouts for the user
parent 184762cc
......@@ -2,7 +2,7 @@ portal = context.getPortalObject()
new_ticket = context.Base_createCloneDocument(form_id=None, batch_mode=True)
portal.portal_catalog.searchAndActivate(
portal.portal_catalog.activate(activity='SQLQueue').searchAndActivate(
portal_type=portal.getPortalEventTypeList(),
default_follow_up_uid=context.getUid(),
method_id='Event_clone',
......
......@@ -7,7 +7,8 @@ else:
event_path = context.getDefaultEventPathValue(portal_type="Event Path")
method_kw = {'event_path': event_path.getRelativeUrl(),
'keep_draft': keep_draft}
portal.portal_catalog.searchAndActivate("Entity_createEventFromDefaultEventPath",
portal.portal_catalog.activate(activity='SQLQueue').searchAndActivate(
"Entity_createEventFromDefaultEventPath",
selection_domain={domain.getParentId(): ('portal_domains', domain.getRelativeUrl())},
method_kw=method_kw)
message = 'Events are being created in background'
......
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