Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
11119d2d
Commit
11119d2d
authored
Aug 23, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Set customer as source of notification
parent
9f8753a1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
36 deletions
+28
-36
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+18
-7
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.xml
...teItem/portal_components/test.erp5.testSlapOSCRMSkins.xml
+3
-24
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow.py
...s/test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow.py
+5
-3
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/ticket_slap_interface_workflow/script_Ticket_notify.py
...ow/ticket_slap_interface_workflow/script_Ticket_notify.py
+2
-2
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
11119d2d
...
@@ -675,7 +675,9 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
...
@@ -675,7 +675,9 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
self
.
assertEqual
(
event
.
getTitle
(),
self
.
assertEqual
(
event
.
getTitle
(),
'Allocation scope of %s changed to %s'
%
(
compute_node
.
getReference
(),
'open/personal'
))
'Allocation scope of %s changed to %s'
%
(
compute_node
.
getReference
(),
'open/personal'
))
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getDestination
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSource
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getSourceSection
())
@
simulate
(
'ERP5Site_isSupportRequestCreationClosed'
,
'*args, **kwargs'
,
'return 0'
)
@
simulate
(
'ERP5Site_isSupportRequestCreationClosed'
,
'*args, **kwargs'
,
'return 0'
)
@
simulate
(
'NotificationTool_getDocumentValue'
,
@
simulate
(
'NotificationTool_getDocumentValue'
,
...
@@ -705,7 +707,9 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
...
@@ -705,7 +707,9 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
self
.
assertEqual
(
event
.
getTitle
(),
self
.
assertEqual
(
event
.
getTitle
(),
'Allocation scope of %s changed to %s'
%
(
compute_node
.
getReference
(),
'open/personal'
))
'Allocation scope of %s changed to %s'
%
(
compute_node
.
getReference
(),
'open/personal'
))
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getDestination
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSource
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getSourceSection
())
@
simulate
(
'ERP5Site_isSupportRequestCreationClosed'
,
'*args, **kwargs'
,
'return 0'
)
@
simulate
(
'ERP5Site_isSupportRequestCreationClosed'
,
'*args, **kwargs'
,
'return 0'
)
@
simulate
(
'ComputeNode_hasContactedRecently'
,
'*args, **kwargs'
,
'return False'
)
@
simulate
(
'ComputeNode_hasContactedRecently'
,
'*args, **kwargs'
,
'return False'
)
...
@@ -737,7 +741,9 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
...
@@ -737,7 +741,9 @@ class TestSlapOSComputeNode_notifyWrongAllocationScope(TestCRMSkinsMixin):
'Allocation scope of %s changed to %s'
%
\
'Allocation scope of %s changed to %s'
%
\
(
compute_node
.
getReference
(),
target_allocation_scope
))
(
compute_node
.
getReference
(),
target_allocation_scope
))
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getDestination
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSource
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getDestination
(),
support_request
.
getSourceSection
())
def
test_ComputeNodeNormalAllocationScope_OpenPersonal
(
self
):
def
test_ComputeNodeNormalAllocationScope_OpenPersonal
(
self
):
compute_node
=
self
.
_makeComputeNode
(
owner
=
self
.
makePerson
(
user
=
0
))[
0
]
compute_node
=
self
.
_makeComputeNode
(
owner
=
self
.
makePerson
(
user
=
0
))[
0
]
...
@@ -1065,7 +1071,9 @@ class TestSlapOSComputeNode_CheckState(TestCRMSkinsMixin):
...
@@ -1065,7 +1071,9 @@ class TestSlapOSComputeNode_CheckState(TestCRMSkinsMixin):
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getDestination
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSource
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getSourceSection
())
@
simulate
(
'ERP5Site_isSupportRequestCreationClosed'
,
'*args, **kwargs'
,
'return 0'
)
@
simulate
(
'ERP5Site_isSupportRequestCreationClosed'
,
'*args, **kwargs'
,
'return 0'
)
@
simulate
(
'NotificationTool_getDocumentValue'
,
@
simulate
(
'NotificationTool_getDocumentValue'
,
...
@@ -1092,7 +1100,8 @@ class TestSlapOSComputeNode_CheckState(TestCRMSkinsMixin):
...
@@ -1092,7 +1100,8 @@ class TestSlapOSComputeNode_CheckState(TestCRMSkinsMixin):
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getDestination
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getSourceSection
())
self
.
assertEqual
(
event
.
getSource
(),
person
.
getRelativeUrl
())
class
TestSlapOSInstanceTree_createSupportRequestEvent
(
SlapOSTestCaseMixin
):
class
TestSlapOSInstanceTree_createSupportRequestEvent
(
SlapOSTestCaseMixin
):
...
@@ -1158,7 +1167,8 @@ class TestSlapOSInstanceTree_createSupportRequestEvent(SlapOSTestCaseMixin):
...
@@ -1158,7 +1167,8 @@ class TestSlapOSInstanceTree_createSupportRequestEvent(SlapOSTestCaseMixin):
self
.
assertEqual
(
event
.
getTitle
(),
ticket_title
)
self
.
assertEqual
(
event
.
getTitle
(),
ticket_title
)
self
.
assertIn
(
instance_tree
.
getReference
(),
event
.
getTextContent
())
self
.
assertIn
(
instance_tree
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getDestination
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSource
(),
person
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getDestination
(),
ticket
.
getSourceSection
())
ticket
.
suspend
()
ticket
.
suspend
()
self
.
tic
()
self
.
tic
()
...
@@ -1576,7 +1586,8 @@ class TestSupportRequestUpdateMonitoringState(SlapOSTestCaseMixin):
...
@@ -1576,7 +1586,8 @@ class TestSupportRequestUpdateMonitoringState(SlapOSTestCaseMixin):
event
=
event_list
[
0
]
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
'Instance Tree was destroyed was destroyed by the user'
)
self
.
assertEqual
(
event
.
getTitle
(),
'Instance Tree was destroyed was destroyed by the user'
)
self
.
assertEqual
(
event
.
getDestination
(),
support_request
.
getDestinationDecision
())
self
.
assertEqual
(
event
.
getSource
(),
support_request
.
getDestinationDecision
())
self
.
assertEqual
(
event
.
getDestination
(),
support_request
.
getSourceSection
())
self
.
assertEqual
(
"invalidated"
,
self
.
assertEqual
(
"invalidated"
,
support_request
.
getSimulationState
())
support_request
.
getSimulationState
())
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.xml
View file @
11119d2d
...
@@ -6,12 +6,6 @@
...
@@ -6,12 +6,6 @@
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
default_reference
</string>
</key>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSCRMSkins
</string>
</value>
<value>
<string>
testSlapOSCRMSkins
</string>
</value>
...
@@ -55,28 +49,13 @@
...
@@ -55,28 +49,13 @@
<item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<key>
<string>
workflow_history
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
</pickle>
...
@@ -89,7 +68,7 @@
...
@@ -89,7 +68,7 @@
<item>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -98,7 +77,7 @@
...
@@ -98,7 +77,7 @@
</dictionary>
</dictionary>
</pickle>
</pickle>
</record>
</record>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
</pickle>
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudTicketSlapInterfaceWorkflow.py
View file @
11119d2d
...
@@ -162,9 +162,9 @@ class TestSlapOSCoreTicketSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -162,9 +162,9 @@ class TestSlapOSCoreTicketSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertEqual
(
self
.
support_request
.
getSimulationState
(),
self
.
assertEqual
(
self
.
support_request
.
getSimulationState
(),
'validated'
)
'validated'
)
self
.
assertEqual
(
self
.
support_request
.
get
DestinationDecis
ion
(),
self
.
assertEqual
(
self
.
support_request
.
get
SourceSect
ion
(),
event
.
getDestination
())
event
.
getDestination
())
self
.
assertEqual
(
person
,
event
.
get
Destination
Value
())
self
.
assertEqual
(
person
,
event
.
get
Source
Value
())
self
.
assertEqual
(
"service_module/slapos_crm_information"
,
self
.
assertEqual
(
"service_module/slapos_crm_information"
,
event
.
getResource
())
event
.
getResource
())
...
@@ -176,7 +176,9 @@ class TestSlapOSCoreTicketSlapInterfaceWorkflow(SlapOSTestCaseMixin):
...
@@ -176,7 +176,9 @@ class TestSlapOSCoreTicketSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self
.
assertEqual
(
event
.
getContentType
(),
"text/html"
)
self
.
assertEqual
(
event
.
getContentType
(),
"text/html"
)
self
.
assertEqual
(
event
.
getPortalType
(),
"Web Message"
)
self
.
assertEqual
(
event
.
getPortalType
(),
"Web Message"
)
self
.
assertEqual
(
event
.
getSource
(),
self
.
assertEqual
(
event
.
getSource
(),
self
.
support_request
.
getSource
())
self
.
support_request
.
getDestinationDecision
())
self
.
assertEqual
(
event
.
getDestination
(),
self
.
support_request
.
getSourceSection
())
# Retry now to see if doesn't create a new message
# Retry now to see if doesn't create a new message
self
.
support_request
.
notify
(
self
.
support_request
.
notify
(
...
...
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/ticket_slap_interface_workflow/script_Ticket_notify.py
View file @
11119d2d
...
@@ -43,8 +43,8 @@ event.edit(
...
@@ -43,8 +43,8 @@ event.edit(
text_content
=
message
,
text_content
=
message
,
start_date
=
DateTime
(),
start_date
=
DateTime
(),
resource
=
resource
,
resource
=
resource
,
source
=
ticket
.
get
Source
(),
source
=
ticket
.
get
DestinationDecision
(),
destination
=
ticket
.
get
DestinationDecision
(),
destination
=
ticket
.
get
Source
(),
follow_up
=
ticket
.
getRelativeUrl
(),
follow_up
=
ticket
.
getRelativeUrl
(),
)
)
event
.
stop
()
event
.
stop
()
...
...
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