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
Labels
Merge Requests
140
Merge Requests
140
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
558e8d72
Commit
558e8d72
authored
Dec 18, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRM: Event.getPropertyDictFromContent should not lookup source/destination when defined on document
parent
b227c438
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
3 deletions
+38
-3
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getPropertyDictFromContent.xml
...ortal_skins/erp5_crm/Event_getPropertyDictFromContent.xml
+2
-2
bt5/erp5_crm/bt/revision
bt5/erp5_crm/bt/revision
+1
-1
product/ERP5/tests/testCRM.py
product/ERP5/tests/testCRM.py
+35
-0
No files found.
bt5/erp5_crm/SkinTemplateItem/portal_skins/erp5_crm/Event_getPropertyDictFromContent.xml
View file @
558e8d72
...
@@ -71,8 +71,8 @@ def getEntityList(text):\n
...
@@ -71,8 +71,8 @@ def getEntityList(text):\n
for entity in Base_getEntityListFromFromHeader(text)]\n
for entity in Base_getEntityListFromFromHeader(text)]\n
\n
\n
content_information = context.getContentInformation()\n
content_information = context.getContentInformation()\n
sender_list = getEntityList(content_information.get(\'From\', \'\'))\n
sender_list =
context.getSourceList() or
getEntityList(content_information.get(\'From\', \'\'))\n
to_list = getEntityList(content_information.get(\'To\', \'\'))\n
to_list =
context.getDestinationList() or
getEntityList(content_information.get(\'To\', \'\'))\n
cc_list = getEntityList(content_information.get(\'CC\', \'\'))\n
cc_list = getEntityList(content_information.get(\'CC\', \'\'))\n
\n
\n
# Build references\n
# Build references\n
...
...
bt5/erp5_crm/bt/revision
View file @
558e8d72
678
679
\ No newline at end of file
\ No newline at end of file
product/ERP5/tests/testCRM.py
View file @
558e8d72
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
import
unittest
import
unittest
import
os
import
os
import
textwrap
from
Products.CMFCore.WorkflowCore
import
WorkflowException
from
Products.CMFCore.WorkflowCore
import
WorkflowException
from
Products.ERP5Type.tests.utils
import
FileUpload
from
Products.ERP5Type.tests.utils
import
FileUpload
...
@@ -728,6 +729,40 @@ class TestCRMMailIngestion(BaseTestCRM):
...
@@ -728,6 +729,40 @@ class TestCRMMailIngestion(BaseTestCRM):
# cloned event got a new reference
# cloned event got a new reference
self
.
assertNotEqual
(
new_event
.
getReference
(),
event
.
getReference
())
self
.
assertNotEqual
(
new_event
.
getReference
(),
event
.
getReference
())
def
test_getPropertyDictFromContent_and_defined_arrow
(
self
):
# If source/destination are set on event, then getPropertyDictFromContent
# should not lookup one based on email address.
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
default_email_coordinate_text
=
'destination@example.com'
,)
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
default_email_coordinate_text
=
'destination@example.com'
,)
source_person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
default_email_coordinate_text
=
'source@example.com'
,)
self
.
tic
()
event
=
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Mail Message'
,
destination_value
=
organisation
,
data
=
'
\
r
\
n
'
.
join
(
textwrap
.
dedent
(
'''
From: Source <source@example.com>
To: destination <destination@example.com>
Subject: mail subject
content
'''
).
splitlines
()[
1
:]))
property_dict
=
event
.
getPropertyDictFromContent
()
# destination is set on the event. In this case it is kept as is.
self
.
assertEquals
([
organisation
.
getRelativeUrl
()],
property_dict
[
'destination_list'
])
# source is not set. In this case it is searched in catalog based on email
# address
self
.
assertEquals
([
source_person
.
getRelativeUrl
()],
property_dict
[
'source_list'
])
def
test_follow_up
(
self
):
def
test_follow_up
(
self
):
# follow up is found automatically, based on the content of the mail, and
# follow up is found automatically, based on the content of the mail, and
# what you defined in preference regexpr.
# what you defined in preference regexpr.
...
...
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