Commit a8f4b89f authored by Romain Courteaud's avatar Romain Courteaud

Clean Event_createFollowUpTicket.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16235 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5f6f61c9
...@@ -69,37 +69,18 @@ ...@@ -69,37 +69,18 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># this script allows to create a new follow up ticket for a given event\n <value> <string># this script allows to create a new follow up ticket for a given event\n
\n evnet = context\n
event_object = context.getObject()\n ticket_module = context.getPortalObject().getDefaultModule(follow_up_ticket_type)\n
\n
if follow_up_ticket_type == "Meeting" :\n
ticket_module = context.getPortalObject().meeting_module\n
elif follow_up_ticket_type == "Support Request" :\n
ticket_module = context.getPortalObject().support_request_module\n
elif follow_up_ticket_type == "Campaign" :\n
ticket_module = context.getPortalObject().campaign_module\n
else :\n
ticket_module = context.getPortalObject().sale_opportunity_module\n
follow_up_ticket_type == "Sale Opportunity"\n
\n \n
# Create a new object\n # Create a new object\n
new_id = str(ticket_module.generateNewId())\n new_object = ticket_module.newContent(\n
context.portal_types.constructContent(type_name = follow_up_ticket_type,\n portal_type=follow_up_ticket_type,\n
container = ticket_module,\n title=follow_up_ticket_title,\n
id = new_id\n destination_decision_list=event_object.getSourceList()\n
)\n
new_object = ticket_module[new_id]\n
\n
\n
# If we do this before, each added line will take 20 times more time\n
# because of programmable acquisition\n
new_object.edit(\n
title = follow_up_ticket_title,\n
destination_decision_value_list = event_object.getSourceValueList()\n
)\n )\n
\n \n
# Now create the relation between the event object and the new follow up ticket\n # Now create the relation between the event object and the new follow up ticket\n
event_object.setFollowUpValueList([new_object])\n event.setFollowUpValueList([new_object])\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -122,7 +103,7 @@ event_object.setFollowUpValueList([new_object])\n ...@@ -122,7 +103,7 @@ event_object.setFollowUpValueList([new_object])\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>follow_up_ticket_title="", follow_up_ticket_type</string> </value> <value> <string>follow_up_ticket_title="Sale Opportunity", follow_up_ticket_type</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -150,14 +131,13 @@ event_object.setFollowUpValueList([new_object])\n ...@@ -150,14 +131,13 @@ event_object.setFollowUpValueList([new_object])\n
<tuple> <tuple>
<string>follow_up_ticket_title</string> <string>follow_up_ticket_title</string>
<string>follow_up_ticket_type</string> <string>follow_up_ticket_type</string>
<string>_getattr_</string>
<string>context</string> <string>context</string>
<string>event_object</string> <string>evnet</string>
<string>_getattr_</string>
<string>ticket_module</string> <string>ticket_module</string>
<string>str</string> <string>event_object</string>
<string>new_id</string>
<string>_getitem_</string>
<string>new_object</string> <string>new_object</string>
<string>event</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -170,7 +150,7 @@ event_object.setFollowUpValueList([new_object])\n ...@@ -170,7 +150,7 @@ event_object.setFollowUpValueList([new_object])\n
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple> <tuple>
<string></string> <string>Sale Opportunity</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
85 86
\ No newline at end of file \ 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