Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
erp5
Commits
50d79dcc
Commit
50d79dcc
authored
Jun 17, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not store aggregated documents in Email document to avoid duplicate data.
parent
4140566d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
6 deletions
+39
-6
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Entity_sendEmail.xml
...nTemplateItem/portal_skins/erp5_base/Entity_sendEmail.xml
+12
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Event_send.xml
...se/SkinTemplateItem/portal_skins/erp5_base/Event_send.xml
+12
-1
bt5/erp5_base/bt/revision
bt5/erp5_base/bt/revision
+1
-1
product/ERP5/Document/EmailDocument.py
product/ERP5/Document/EmailDocument.py
+14
-3
No files found.
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Entity_sendEmail.xml
View file @
50d79dcc
...
@@ -83,6 +83,17 @@ mail_message = context.Base_createMailMessageAsString(from_url,\n
...
@@ -83,6 +83,17 @@ mail_message = context.Base_createMailMessageAsString(from_url,\n
event.sendMailHostMessage(mail_message)\n
event.sendMailHostMessage(mail_message)\n
\n
\n
if not event.hasData():\n
if not event.hasData():\n
if len(embedded_file_list):\n
# do not store aggregated documents in Email document\n
# to avoid duplicate data\n
tmp_mail_message = context.Base_createMailMessageAsString(from_url,\n
to_url,\n
subject,\n
body,\n
content_type,\n
attachment_list=attachment_list)\n
event.setData(tmp_mail_message)\n
else:\n
event.setData(mail_message)\n
event.setData(mail_message)\n
</string>
</value>
</string>
</value>
</item>
</item>
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Event_send.xml
View file @
50d79dcc
...
@@ -110,7 +110,18 @@ if download or not use_activity:\n
...
@@ -110,7 +110,18 @@ if download or not use_activity:\n
attachment_list=attachment_list,\n
attachment_list=attachment_list,\n
embedded_file_list=embedded_file_list)\n
embedded_file_list=embedded_file_list)\n
\n
\n
context.edit(data=mail_message)\n
if len(embedded_file_list):\n
# do not store aggregated documents in Email document\n
# to avoid duplicate data\n
tmp_mail_message = context.Base_createMailMessageAsString(from_url,\n
to_url,\n
subject,\n
body,\n
content_type,\n
attachment_list=attachment_list)\n
context.setData(tmp_mail_message)\n
else:\n
context.setData(mail_message)\n
if not use_activity:\n
if not use_activity:\n
context.activate(activity=\'SQLQueue\').sendMailHostMessage(mail_message)\n
context.activate(activity=\'SQLQueue\').sendMailHostMessage(mail_message)\n
\n
\n
...
...
bt5/erp5_base/bt/revision
View file @
50d79dcc
1041
1042
\ No newline at end of file
\ No newline at end of file
product/ERP5/Document/EmailDocument.py
View file @
50d79dcc
...
@@ -665,6 +665,7 @@ class EmailDocument(TextDocument):
...
@@ -665,6 +665,7 @@ class EmailDocument(TextDocument):
if attachment_list is None:
if attachment_list is None:
attachment_list = []
attachment_list = []
document_type_list = self.getPortalDocumentTypeList()
document_type_list = self.getPortalDocumentTypeList()
embedded_attachment_list = []
for attachment in self.getAggregateValueList():
for attachment in self.getAggregateValueList():
mime_type = None
mime_type = None
content = None
content = None
...
@@ -704,7 +705,7 @@ class EmailDocument(TextDocument):
...
@@ -704,7 +705,7 @@ class EmailDocument(TextDocument):
if not isinstance(content, str):
if not isinstance(content, str):
content = str(content)
content = str(content)
attachment_list.append({'
mime_type
':mime_type,
embedded_
attachment_list.append({'
mime_type
':mime_type,
'
content
':content,
'
content
':content,
'
name
':attachment.getReference()}
'
name
':attachment.getReference()}
)
)
...
@@ -713,13 +714,23 @@ class EmailDocument(TextDocument):
...
@@ -713,13 +714,23 @@ class EmailDocument(TextDocument):
for to_url in to_url_list:
for to_url in to_url_list:
mime_message = buildEmailMessage(from_url=from_url, to_url=to_url,
mime_message = buildEmailMessage(from_url=from_url, to_url=to_url,
msg=body, subject=subject,
msg=body, subject=subject,
attachment_list=
attachment_list
,
attachment_list=
(attachment_list + embedded_attachment_list)
,
additional_headers=additional_headers)
additional_headers=additional_headers)
mail_message = mime_message.as_string()
mail_message = mime_message.as_string()
self.activate(activity='
SQLQueue
').sendMailHostMessage(mail_message)
self.activate(activity='
SQLQueue
').sendMailHostMessage(mail_message)
# Save one of mail messages.
# Save one of mail messages.
if mail_message is not None:
if mail_message is not None:
if len(embedded_attachment_list):
# do not store aggregated documents in Email document
# to avoid duplicate data
tmp_mime_message = buildEmailMessage(from_url=from_url, to_url=to_url,
msg=body, subject=subject,
attachment_list=attachment_list,
additional_headers=additional_headers)
tmp_mail_message = mime_message.as_string()
self.setData(tmp_mail_message)
else:
self.setData(mail_message)
self.setData(mail_message)
# Only for debugging purpose
# Only for debugging purpose
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment