Commit 30e787cf authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Rely on preferences rather them on hardcoded paths

parent be11a1bd
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Support Request" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>source_section/organisation_module/slapos</string>
<string>source_trade/organisation_module/slapos</string>
<string>source/organisation_module/slapos</string>
<string>resource/service_module/slapos_crm_monitoring</string>
</tuple>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>SR-282</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_crm_support_request_template_for_monitoring</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Support Request</string> </value>
</item>
<item>
<key> <string>price</string> </key>
<value> <float>0.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template Support Request For Monitoring</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -36,13 +36,14 @@ if support_request_in_progress is not None: ...@@ -36,13 +36,14 @@ if support_request_in_progress is not None:
support_request.getAggregateUid() == aggregate_value.getUid(): support_request.getAggregateUid() == aggregate_value.getUid():
return portal.restrictedTraverse(support_request_in_progress) return portal.restrictedTraverse(support_request_in_progress)
# Ensure resoure is Monitoring
resource = portal.service_module.\ resource = portal.service_module.\
slapos_crm_monitoring.getRelativeUrl() slapos_crm_monitoring.getRelativeUrl()
support_request = portal.\ support_request = portal.restrictedTraverse(
support_request_module.\ portal.portal_preferences.getPreferredSupportRequestTemplate())\
slapos_crm_support_request_template_for_monitoring.\ .Base_createCloneDocument(batch_mode=1)
Base_createCloneDocument(batch_mode=1)
support_request.edit( support_request.edit(
title = title, title = title,
description = description, description = description,
......
...@@ -19,9 +19,10 @@ if transactional_event is not None: ...@@ -19,9 +19,10 @@ if transactional_event is not None:
(transactional_event.getTitle() == message_title): (transactional_event.getTitle() == message_title):
return transactional_event return transactional_event
event = portal.event_module.slapos_crm_web_message_template.\ template = portal.restrictedTraverse(
Base_createCloneDocument(batch_mode=1) portal.portal_preferences.getPreferredWebMessageTemplate())
event = template.Base_createCloneDocument(batch_mode=1)
event.edit( event.edit(
title=message_title, title=message_title,
text_content=message, text_content=message,
......
...@@ -691,9 +691,9 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort): ...@@ -691,9 +691,9 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
def _makeSupportRequest(self): def _makeSupportRequest(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1) .Base_createCloneDocument(batch_mode=1)
support_request = self.portal.support_request_module.\ support_request = self.portal.restrictedTraverse(
slapos_crm_support_request_template_for_monitoring\ self.portal.portal_preferences.getPreferredSupportRequestTemplate()).\
.Base_createCloneDocument(batch_mode=1) Base_createCloneDocument(batch_mode=1)
support_request.validate() support_request.validate()
new_id = self.generateNewId() new_id = self.generateNewId()
support_request.edit( support_request.edit(
......
...@@ -1183,11 +1183,9 @@ class TestSlapOSComputer_CheckState(TestCRMSkinsMixin): ...@@ -1183,11 +1183,9 @@ class TestSlapOSComputer_CheckState(TestCRMSkinsMixin):
self._cancelTestSupportRequestList("% TESTCOMPT-%") self._cancelTestSupportRequestList("% TESTCOMPT-%")
def _makeSupportRequest(self): def _makeSupportRequest(self):
support_request = self.portal.\ return self.portal.restrictedTraverse(
support_request_module.\ self.portal.portal_preferences.getPreferredSupportRequestTemplate()).\
slapos_crm_support_request_template_for_monitoring.\
Base_createCloneDocument(batch_mode=1) Base_createCloneDocument(batch_mode=1)
return support_request
def _makeNotificationMessage(self, reference): def _makeNotificationMessage(self, reference):
notification_message = self.portal.notification_message_module.newContent( notification_message = self.portal.notification_message_module.newContent(
...@@ -1880,12 +1878,9 @@ class TestSupportRequestUpdateMonitoringState(SlapOSTestCaseMixin): ...@@ -1880,12 +1878,9 @@ class TestSupportRequestUpdateMonitoringState(SlapOSTestCaseMixin):
return hosting_subscription return hosting_subscription
def _makeSupportRequest(self): def _makeSupportRequest(self):
support_request = self.portal.\ return self.portal.restrictedTraverse(
support_request_module.\ self.portal.portal_preferences.getPreferredSupportRequestTemplate()).\
slapos_crm_support_request_template_for_monitoring.\
Base_createCloneDocument(batch_mode=1) Base_createCloneDocument(batch_mode=1)
return support_request
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0') @simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
@simulate('SupportRequest_updateMonitoringDestroyRequestedState', @simulate('SupportRequest_updateMonitoringDestroyRequestedState',
......
...@@ -8,4 +8,3 @@ sale_trade_condition_module/slapos_ticket_trade_condition ...@@ -8,4 +8,3 @@ sale_trade_condition_module/slapos_ticket_trade_condition
sale_trade_condition_module/slapos_ticket_trade_condition/** sale_trade_condition_module/slapos_ticket_trade_condition/**
service_module/slapos_crm_* service_module/slapos_crm_*
support_request_module/slapos_crm_support_request_template support_request_module/slapos_crm_support_request_template
support_request_module/slapos_crm_support_request_template_for_monitoring
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment