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
Carlos Ramos Carreño
slapos.core
Commits
16752b7f
Commit
16752b7f
authored
Aug 26, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Fixup for ticket workflow
See merge request
!412
parents
11703894
e6609b6f
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
577 additions
and
38 deletions
+577
-38
master/bt5/slapos_crm/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+12
-0
master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSEventConstraint.xml
...lateItem/portal_property_sheets/SlapOSEventConstraint.xml
+66
-0
master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSEventConstraint/customer_source_destination_consistency_constraint.xml
...nt/customer_source_destination_consistency_constraint.xml
+80
-0
master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSSupportRequestConstraint.xml
...portal_property_sheets/SlapOSSupportRequestConstraint.xml
+66
-0
master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSSupportRequestConstraint/causality_source_destination_constraint_constraint.xml
...nt/causality_source_destination_constraint_constraint.xml
+80
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Event_checkCustomerAsSourceOrDestinationConsistency.py
...ng/Event_checkCustomerAsSourceOrDestinationConsistency.py
+11
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Event_checkCustomerAsSourceOrDestinationConsistency.xml
...g/Event_checkCustomerAsSourceOrDestinationConsistency.xml
+62
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_checkCausalitySourceDestinationConsistency.py
...portRequest_checkCausalitySourceDestinationConsistency.py
+14
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_checkCausalitySourceDestinationConsistency.xml
...ortRequest_checkCausalitySourceDestinationConsistency.xml
+62
-0
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+106
-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
master/bt5/slapos_crm/bt/template_portal_type_property_sheet_list
...t5/slapos_crm/bt/template_portal_type_property_sheet_list
+5
-1
master/bt5/slapos_crm/bt/template_property_sheet_id_list
master/bt5/slapos_crm/bt/template_property_sheet_id_list
+3
-1
No files found.
master/bt5/slapos_crm/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
16752b7f
<property_sheet_list>
<property_sheet_list>
<portal_type
id=
"Mail Message"
>
<item>
SlapOSEventConstraint
</item>
</portal_type>
<portal_type
id=
"Regularisation Request"
>
<portal_type
id=
"Regularisation Request"
>
<item>
Codification
</item>
<item>
Codification
</item>
</portal_type>
</portal_type>
<portal_type
id=
"Site Message"
>
<item>
SlapOSEventConstraint
</item>
</portal_type>
<portal_type
id=
"Support Request"
>
<item>
SlapOSSupportRequestConstraint
</item>
</portal_type>
<portal_type
id=
"Web Message"
>
<item>
SlapOSEventConstraint
</item>
</portal_type>
</property_sheet_list>
</property_sheet_list>
\ No newline at end of file
master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSEventConstraint.xml
0 → 100644
View file @
16752b7f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SlapOSEventConstraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSEventConstraint/customer_source_destination_consistency_constraint.xml
0 → 100644
View file @
16752b7f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Script Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
constraint_type/default
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
customer_source_destination_consistency_constraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Script Constraint
</string>
</value>
</item>
<item>
<key>
<string>
script_id
</string>
</key>
<value>
<string>
Event_checkCustomerAsSourceOrDestinationConsistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<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>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSSupportRequestConstraint.xml
0 → 100644
View file @
16752b7f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SlapOSSupportRequestConstraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/PropertySheetTemplateItem/portal_property_sheets/SlapOSSupportRequestConstraint/causality_source_destination_constraint_constraint.xml
0 → 100644
View file @
16752b7f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Script Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
constraint_type/default
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
causality_source_destination_constraint_constraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Script Constraint
</string>
</value>
</item>
<item>
<key>
<string>
script_id
</string>
</key>
<value>
<string>
SupportRequest_checkCausalitySourceDestinationConsistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<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>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Event_checkCustomerAsSourceOrDestinationConsistency.py
0 → 100644
View file @
16752b7f
support_request
=
context
.
getFollowUpValue
(
portal_type
=
"Support Request"
)
error_list
=
[]
if
support_request
:
customer
=
support_request
.
getDestinationDecision
()
if
context
.
getSource
()
!=
customer
and
\
customer
not
in
context
.
getDestinationList
()
:
error_list
.
append
(
'Customer should be source or destination of the event'
)
return
error_list
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Event_checkCustomerAsSourceOrDestinationConsistency.xml
0 → 100644
View file @
16752b7f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
fixit=False
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Event_checkCustomerAsSourceOrDestinationConsistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_checkCausalitySourceDestinationConsistency.py
0 → 100644
View file @
16752b7f
portal
=
context
.
getPortalObject
()
event
=
context
.
getCausalityValue
(
portal_type
=
portal
.
getPortalEventTypeList
())
error_list
=
[]
if
event
:
if
event
.
getSource
()
!=
context
.
getDestinationDecision
():
error_list
.
append
(
'Sender of the related event should be the customer'
)
if
event
.
getDestination
()
!=
context
.
getSourceSection
():
error_list
.
append
(
'Destination of the related event should be the slapos organisation'
)
return
error_list
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_checkCausalitySourceDestinationConsistency.xml
0 → 100644
View file @
16752b7f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
fixit=False
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SupportRequest_checkCausalitySourceDestinationConsistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
16752b7f
...
@@ -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
()
...
@@ -1495,6 +1505,94 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
...
@@ -1495,6 +1505,94 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
None
,
None
,
instance_tree
.
InstanceTree_checkSoftwareInstanceState
())
instance_tree
.
InstanceTree_checkSoftwareInstanceState
())
class
TestCRMPropertySheetConstraint
(
SlapOSTestCaseMixin
):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
portal
=
self
.
getPortalObject
()
self
.
ticket_trade_condition
=
portal
.
sale_trade_condition_module
.
slapos_ticket_trade_condition
person_user
=
self
.
makePerson
()
self
.
tic
()
# Login as new user
self
.
login
(
person_user
.
getUserId
())
new_person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
assertEqual
(
person_user
.
getRelativeUrl
(),
new_person
.
getRelativeUrl
())
self
.
support_request
=
portal
.
support_request_module
.
newContent
(
portal_type
=
"Support Request"
,
destination_decision
=
person_user
.
getRelativeUrl
(),
specialise
=
self
.
ticket_trade_condition
.
getRelativeUrl
()
)
# Value set by the init
self
.
assertTrue
(
self
.
support_request
.
getReference
().
startswith
(
"SR-"
),
"Reference don't start with SR- : %s"
%
self
.
support_request
.
getReference
())
def
beforeTearDown
(
self
):
transaction
.
abort
()
def
testCheckCausalitySourceDestinationConsistency
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
support_request
.
approveRegistration
()
self
.
tic
()
self
.
logout
()
self
.
login
()
event
=
self
.
support_request
.
getCausalityValue
()
self
.
assertNotEqual
(
event
,
None
)
self
.
assertFalse
(
event
.
checkConsistency
())
self
.
assertFalse
(
self
.
support_request
.
checkConsistency
())
source
=
event
.
getDestination
()
event
.
setDestination
(
person
.
getRelativeUrl
())
non_consistency_list
=
[
str
(
i
.
getTranslatedMessage
())
for
i
in
self
.
support_request
.
checkConsistency
()]
self
.
assertEqual
(
non_consistency_list
,
[
'Destination of the related event should be the slapos organisation'
])
event
.
setSource
(
source
)
non_consistency_list
=
[
str
(
i
.
getTranslatedMessage
())
for
i
in
self
.
support_request
.
checkConsistency
()]
self
.
assertEqual
(
non_consistency_list
,
[
'Sender of the related event should be the customer'
,
'Destination of the related event should be the slapos organisation'
])
def
testCheckCustomerAsSourceOrDestinationConsistency
(
self
):
person
=
self
.
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
self
.
support_request
.
approveRegistration
()
self
.
tic
()
self
.
logout
()
self
.
login
()
event
=
self
.
support_request
.
getCausalityValue
()
self
.
assertNotEqual
(
event
,
None
)
self
.
assertFalse
(
event
.
checkConsistency
())
self
.
assertFalse
(
self
.
support_request
.
checkConsistency
())
person_user
=
self
.
makePerson
()
self
.
tic
()
event
.
setSource
(
person_user
.
getRelativeUrl
())
non_consistency_list
=
[
str
(
i
.
getTranslatedMessage
())
for
i
in
event
.
checkConsistency
()]
self
.
assertEqual
(
non_consistency_list
,
[
'Customer should be source or destination of the event'
])
event
.
setDestination
(
person
.
getRelativeUrl
())
self
.
assertFalse
(
event
.
checkConsistency
())
class
TestSupportRequestUpdateMonitoringState
(
SlapOSTestCaseMixin
):
class
TestSupportRequestUpdateMonitoringState
(
SlapOSTestCaseMixin
):
def
_makeInstanceTree
(
self
):
def
_makeInstanceTree
(
self
):
...
@@ -1576,7 +1674,8 @@ class TestSupportRequestUpdateMonitoringState(SlapOSTestCaseMixin):
...
@@ -1576,7 +1674,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 @
16752b7f
...
@@ -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 @
16752b7f
...
@@ -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 @
16752b7f
...
@@ -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
()
...
...
master/bt5/slapos_crm/bt/template_portal_type_property_sheet_list
View file @
16752b7f
Mail Message | SlapOSEventConstraint
Regularisation Request | Codification
Regularisation Request | Codification
Site Message | SlapOSEventConstraint
Support Request | SlapOSSupportRequestConstraint
Web Message | SlapOSEventConstraint
\ No newline at end of file
master/bt5/slapos_crm/bt/template_property_sheet_id_list
View file @
16752b7f
SlapOSCRMSystemPreference
SlapOSCRMSystemPreference
SlapOSEventConstraint
SlapOSSupportRequestConstraint
\ No newline at end of file
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