Commit 6bddba30 authored by Jérome Perrin's avatar Jérome Perrin

crm: keep event aggregate when setting content from notification message

If event has an aggregate relation already, merge it with the
aggregate relation of notification message.

/reviewed-on nexedi/erp5!873
parent 7505e054
...@@ -3,7 +3,7 @@ if not language: ...@@ -3,7 +3,7 @@ if not language:
language = context.getLanguage() language = context.getLanguage()
if not language: if not language:
language = portal.portal_preferences.getPreferredCustomerRelationLanguage() language = portal.portal_preferences.getPreferredCustomerRelationLanguage()
notification_message = portal.portal_notifications.getDocumentValue( notification_message = portal.portal_notifications.getDocumentValue(
language=language, language=language,
reference=reference) reference=reference)
...@@ -23,8 +23,9 @@ if notification_message is not None: ...@@ -23,8 +23,9 @@ if notification_message is not None:
mime, text_content = notification_message.convert(target_format, mime, text_content = notification_message.convert(target_format,
substitution_method_parameter_dict=substitution_method_parameter_dict) substitution_method_parameter_dict=substitution_method_parameter_dict)
context.setTextContent(text_content) context.setTextContent(text_content)
context.setAggregateList(notification_message.getProperty('aggregate_list', [])) context.setAggregateSet(
context.getAggregateList() + notification_message.getProperty('aggregate_list', []))
if not context.hasTitle(): if not context.hasTitle():
context.setTitle(notification_message.asSubjectText( context.setTitle(notification_message.asSubjectText(
substitution_method_parameter_dict=substitution_method_parameter_dict)) substitution_method_parameter_dict=substitution_method_parameter_dict))
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