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:
support_request.getAggregateUid() == aggregate_value.getUid():
return portal.restrictedTraverse(support_request_in_progress)
# Ensure resoure is Monitoring
resource = portal.service_module.\
slapos_crm_monitoring.getRelativeUrl()
support_request = portal.\
support_request_module.\
slapos_crm_support_request_template_for_monitoring.\
Base_createCloneDocument(batch_mode=1)
support_request = portal.restrictedTraverse(
portal.portal_preferences.getPreferredSupportRequestTemplate())\
.Base_createCloneDocument(batch_mode=1)
support_request.edit(
title = title,
description = description,
......
......@@ -19,9 +19,10 @@ if transactional_event is not None:
(transactional_event.getTitle() == message_title):
return transactional_event
event = portal.event_module.slapos_crm_web_message_template.\
Base_createCloneDocument(batch_mode=1)
template = portal.restrictedTraverse(
portal.portal_preferences.getPreferredWebMessageTemplate())
event = template.Base_createCloneDocument(batch_mode=1)
event.edit(
title=message_title,
text_content=message,
......
......@@ -691,9 +691,9 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
def _makeSupportRequest(self):
person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1)
support_request = self.portal.support_request_module.\
slapos_crm_support_request_template_for_monitoring\
.Base_createCloneDocument(batch_mode=1)
support_request = self.portal.restrictedTraverse(
self.portal.portal_preferences.getPreferredSupportRequestTemplate()).\
Base_createCloneDocument(batch_mode=1)
support_request.validate()
new_id = self.generateNewId()
support_request.edit(
......
......@@ -1183,11 +1183,9 @@ class TestSlapOSComputer_CheckState(TestCRMSkinsMixin):
self._cancelTestSupportRequestList("% TESTCOMPT-%")
def _makeSupportRequest(self):
support_request = self.portal.\
support_request_module.\
slapos_crm_support_request_template_for_monitoring.\
return self.portal.restrictedTraverse(
self.portal.portal_preferences.getPreferredSupportRequestTemplate()).\
Base_createCloneDocument(batch_mode=1)
return support_request
def _makeNotificationMessage(self, reference):
notification_message = self.portal.notification_message_module.newContent(
......@@ -1880,12 +1878,9 @@ class TestSupportRequestUpdateMonitoringState(SlapOSTestCaseMixin):
return hosting_subscription
def _makeSupportRequest(self):
support_request = self.portal.\
support_request_module.\
slapos_crm_support_request_template_for_monitoring.\
return self.portal.restrictedTraverse(
self.portal.portal_preferences.getPreferredSupportRequestTemplate()).\
Base_createCloneDocument(batch_mode=1)
return support_request
@simulate('ERP5Site_isSupportRequestCreationClosed', '','return 0')
@simulate('SupportRequest_updateMonitoringDestroyRequestedState',
......
......@@ -7,5 +7,4 @@ regularisation_request_module/slapos_crm_regularisation_request_template
sale_trade_condition_module/slapos_ticket_trade_condition
sale_trade_condition_module/slapos_ticket_trade_condition/**
service_module/slapos_crm_*
support_request_module/slapos_crm_support_request_template
support_request_module/slapos_crm_support_request_template_for_monitoring
\ No newline at end of file
support_request_module/slapos_crm_support_request_template
\ 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