Commit b49db358 authored by Nicolas Wavrant's avatar Nicolas Wavrant

erp5_crm: introduce a batch_mode in Event_createResponse

parent 49b9a3fe
......@@ -20,17 +20,25 @@ if response_event_notification_message:
substitution_method_parameter_dict=dict(reply_body=context.getReplyBody(),
reply_subject=context.getReplySubject()))
message = portal.Base_translateString('Response Created.')
def redirect(obj, view):
if batch_mode:
return response
else:
return obj.Base_redirect(
view,
keep_items={'portal_status_message': portal.Base_translateString('Response Created.')}
)
if response_workflow_action == 'send':
response.start()
return context.Base_redirect(form_id, keep_items={'portal_status_message': message})
return redirect(context, form_id)
elif response_workflow_action == 'plan':
response.plan()
return context.Base_redirect(form_id, keep_items={'portal_status_message': message})
return redirect(context, form_id)
elif response_workflow_action == 'deliver':
response.deliver()
return response.Base_redirect('view', keep_items={'portal_status_message': message})
return redirect(response, 'view')
elif response_workflow_action == 'draft':
return response.Base_redirect('view', keep_items={'portal_status_message': message})
return redirect(response, 'view')
else:
raise NotImplementedError('Do not know what to do')
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form_id=None, response_event_portal_type=None, response_event_resource=None, response_event_title=None, response_event_text_content=None, response_event_start_date=None, response_workflow_action=None, response_event_notification_message=None, default_destination=None, response_event_content_type=None, **kw</string> </value>
<value> <string>form_id=None, response_event_portal_type=None, response_event_resource=None, response_event_title=None, response_event_text_content=None, response_event_start_date=None, response_workflow_action=None, response_event_notification_message=None, default_destination=None, response_event_content_type=None, batch_mode=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
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