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
737028ad
Commit
737028ad
authored
Sep 28, 2016
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: Use aggregate instead source_project to aggregate computers and Hosting Subscriptions
parent
4675c289
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
23 deletions
+27
-23
master/bt5/slapos_crm/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
...PortalTypeBaseCategoryTemplateItem/base_category_list.xml
+3
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Base_generateSupportRequestForSlapOS.py
...os_crm_monitoring/Base_generateSupportRequestForSlapOS.py
+13
-13
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+9
-9
master/bt5/slapos_crm/bt/template_portal_type_base_category_list
...bt5/slapos_crm/bt/template_portal_type_base_category_list
+2
-1
No files found.
master/bt5/slapos_crm/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
View file @
737028ad
...
...
@@ -5,4 +5,7 @@
<portal_type
id=
"Regularisation Request Module"
>
<item>
business_application
</item>
</portal_type>
<portal_type
id=
"Support Request"
>
<item>
aggregate
</item>
</portal_type>
</base_category_list>
\ No newline at end of file
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Base_generateSupportRequestForSlapOS.py
View file @
737028ad
from
DateTime
import
DateTime
portal
=
context
.
getPortalObject
()
source_project
_value
=
portal
.
restrictedTraverse
(
source_relative_url
)
if
source_project
_value
.
getPortalType
()
==
"Computer"
:
destination_decision
=
source_project
_value
.
getSourceAdministration
()
elif
source_project
_value
.
getPortalType
()
==
"Software Instance"
:
destination_decision
=
source_project
_value
.
getSpecialiseValue
().
getDestinationSection
()
elif
source_project
_value
.
getPortalType
()
==
"Hosting Subscription"
:
destination_decision
=
source_project
_value
.
getDestinationSection
()
elif
source_project
_value
.
getPortalType
()
==
"Software Installation"
:
destination_decision
=
source_project
_value
.
getDestinationSection
()
aggregate
_value
=
portal
.
restrictedTraverse
(
source_relative_url
)
if
aggregate
_value
.
getPortalType
()
==
"Computer"
:
destination_decision
=
aggregate
_value
.
getSourceAdministration
()
elif
aggregate
_value
.
getPortalType
()
==
"Software Instance"
:
destination_decision
=
aggregate
_value
.
getSpecialiseValue
().
getDestinationSection
()
elif
aggregate
_value
.
getPortalType
()
==
"Hosting Subscription"
:
destination_decision
=
aggregate
_value
.
getDestinationSection
()
elif
aggregate
_value
.
getPortalType
()
==
"Software Installation"
:
destination_decision
=
aggregate
_value
.
getDestinationSection
()
else
:
destination_decision
=
None
...
...
@@ -22,7 +22,7 @@ support_request_in_progress = portal.portal_catalog.getResultValue(
portal_type
=
'Support Request'
,
title
=
title
,
simulation_state
=
[
"validated"
,
"submitted"
,
"suspended"
],
source_project_uid
=
source_project
_value
.
getUid
(),
aggregate_uid
=
aggregate
_value
.
getUid
(),
)
if
support_request_in_progress
is
not
None
:
...
...
@@ -33,7 +33,7 @@ support_request_in_progress = context.REQUEST.get("support_request_in_progress",
if
support_request_in_progress
is
not
None
:
support_request
=
portal
.
restrictedTraverse
(
support_request_in_progress
,
None
)
if
support_request
and
support_request
.
getTitle
()
==
title
and
\
support_request
.
get
SourceProjectUid
()
==
source_project
_value
.
getUid
():
support_request
.
get
AggregatetUid
()
==
aggregate
_value
.
getUid
():
return
portal
.
restrictedTraverse
(
support_request_in_progress
)
resource
=
portal
.
service_module
.
\
...
...
@@ -48,7 +48,7 @@ support_request.edit(
description
=
description
,
start_date
=
DateTime
(),
destination_decision
=
destination_decision
,
source_project_value
=
source_project
_value
,
aggregate_value
=
aggregate
_value
,
resource
=
resource
)
support_request
.
validate
()
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
737028ad
...
...
@@ -2168,7 +2168,7 @@ class TestSlapOSComputer_notifyWrongAllocationScope(testSlapOSMixin):
portal_type
=
'Support Request'
,
title
=
request_title
,
simulation_state
=
'suspended'
,
source_project
_uid
=
computer
.
getUid
()
aggregate
_uid
=
computer
.
getUid
()
)
return
support_request
...
...
@@ -2659,7 +2659,7 @@ class TestSlapOSGenerateSupportRequestForSlapOS(testSlapOSMixin):
self
.
computer
.
getSourceAdministration
())
self
.
assertEquals
(
support_request
.
getTitle
(),
title
)
self
.
assertEquals
(
support_request
.
getDescription
(),
title
)
self
.
assertEquals
(
support_request
.
get
SourceProject
Value
(),
self
.
assertEquals
(
support_request
.
get
Aggregate
Value
(),
self
.
computer
)
def
test_software_instance_Base_generateSupportRequestForSlapOS
(
self
):
...
...
@@ -2685,7 +2685,7 @@ class TestSlapOSGenerateSupportRequestForSlapOS(testSlapOSMixin):
hosting_subscription
.
getDestinationSection
())
self
.
assertEquals
(
support_request
.
getTitle
(),
title
)
self
.
assertEquals
(
support_request
.
getDescription
(),
title
)
self
.
assertEquals
(
support_request
.
get
SourceProject
Value
(),
self
.
assertEquals
(
support_request
.
get
Aggregate
Value
(),
instance
)
def
test_hosting_subscription_Base_generateSupportRequestForSlapOS
(
self
):
...
...
@@ -2709,7 +2709,7 @@ class TestSlapOSGenerateSupportRequestForSlapOS(testSlapOSMixin):
self
.
assertEquals
(
support_request
.
getTitle
(),
title
)
self
.
assertEquals
(
support_request
.
getDescription
(),
title
)
self
.
assertEquals
(
support_request
.
get
SourceProject
Value
(),
self
.
assertEquals
(
support_request
.
get
Aggregate
Value
(),
hosting_subscription
)
def
test_software_installation_Base_generateSupportRequestForSlapOS
(
self
):
...
...
@@ -2733,7 +2733,7 @@ class TestSlapOSGenerateSupportRequestForSlapOS(testSlapOSMixin):
self
.
assertEquals
(
support_request
.
getTitle
(),
title
)
self
.
assertEquals
(
support_request
.
getDescription
(),
title
)
self
.
assertEquals
(
support_request
.
get
SourceProject
Value
(),
self
.
assertEquals
(
support_request
.
get
Aggregate
Value
(),
software_installation
)
...
...
@@ -2858,7 +2858,7 @@ class TestSlapOSComputer_CheckState(testSlapOSMixin):
portal_type
=
'Support Request'
,
title
=
request_title
,
simulation_state
=
'validated'
,
source_project
_uid
=
computer_uid
aggregate
_uid
=
computer_uid
)
return
support_request
...
...
@@ -3046,7 +3046,7 @@ class TestSlapOSHostingSubscription_createSupportRequestEvent(testSlapOSMixin):
support_request
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
'Support Request'
,
simulation_state
=
"validated"
,
source_project
_uid
=
hosting_suscription_uid
aggregate
_uid
=
hosting_suscription_uid
)
return
support_request
...
...
@@ -3433,7 +3433,7 @@ class TestSupportRequestTrySendNotificationMessage(testSlapOSMixin):
support_request
=
self
.
portal
.
support_request_module
.
newContent
(
\
title
=
title
,
description
=
title
,
destination_decision
=
self
.
computer
.
getSourceAdministration
(),
source_project
_value
=
self
.
computer
.
getRelativeUrl
())
aggregate
_value
=
self
.
computer
.
getRelativeUrl
())
support_request
.
validate
()
self
.
tic
()
...
...
@@ -3484,7 +3484,7 @@ class TestSupportRequestTrySendNotificationMessage(testSlapOSMixin):
another_support_request
=
self
.
portal
.
support_request_module
.
newContent
(
\
title
=
title
,
description
=
title
,
destination_decision
=
self
.
computer
.
getSourceAdministration
(),
source_project
_value
=
self
.
computer
.
getRelativeUrl
())
aggregate
_value
=
self
.
computer
.
getRelativeUrl
())
another_support_request
.
validate
()
self
.
tic
()
...
...
master/bt5/slapos_crm/bt/template_portal_type_base_category_list
View file @
737028ad
Regularisation Request Module | business_application
Regularisation Request | specialise
Support Request | aggregate
\ 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