diff --git a/bt5/erp5_short_message/SkinTemplateItem/portal_skins/erp5_short_message/ShortMessage_send.py b/bt5/erp5_short_message/SkinTemplateItem/portal_skins/erp5_short_message/ShortMessage_send.py index e0a08ae5f719d9542b0fade832280926b74fdf16..4c5b1615cb9904b2a4d231a47004f6d519cfc291 100644 --- a/bt5/erp5_short_message/SkinTemplateItem/portal_skins/erp5_short_message/ShortMessage_send.py +++ b/bt5/erp5_short_message/SkinTemplateItem/portal_skins/erp5_short_message/ShortMessage_send.py @@ -29,5 +29,17 @@ if not body: if not context.getStartDate(): context.setStartDate(DateTime()) -context.portal_sms.send(text=body,recipient=to_url,sender=from_url,sender_title=from_title,message_type="text", - test=download, document_relative_url=context.getRelativeUrl(), **kw) +context.portal_sms.activate( + activity="SQLQueue", + # We do not retry these activities not to send SMS multiple times + max_retry=0, + conflict_retry=False, +).send( + text=body, + recipient=to_url, + sender=from_url, + sender_title=from_title, + message_type="text", + test=download, + document_relative_url=context.getRelativeUrl(), + **kw) diff --git a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow.xml b/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow.xml deleted file mode 100644 index 8014509ee0a78b418c04c98fa03aa4ebd0eeeec9..0000000000000000000000000000000000000000 --- a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="InteractionWorkflowDefinition" module="Products.ERP5.InteractionWorkflow"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>_objects</string> </key> - <value> - <tuple/> - </value> - </item> - <item> - <key> <string>creation_guard</string> </key> - <value> - <none/> - </value> - </item> - <item> - <key> <string>description</string> </key> - <value> <string>Define all interaction arrount short message</string> </value> - </item> - <item> - <key> <string>groups</string> </key> - <value> - <tuple/> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>short_message_interaction_workflow</string> </value> - </item> - <item> - <key> <string>manager_bypass</string> </key> - <value> <int>0</int> </value> - </item> - <item> - <key> <string>title</string> </key> - <value> <string>Short Message Interaction Workflow Definition</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/interactions.xml b/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/interactions.xml deleted file mode 100644 index e18bf8cbf778a6808aa24ec39bba4b527d7b1bef..0000000000000000000000000000000000000000 --- a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/interactions.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="Interaction" module="Products.ERP5.Interaction"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>_mapping</string> </key> - <value> - <dictionary/> - </value> - </item> - <item> - <key> <string>_objects</string> </key> - <value> - <tuple/> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>interactions</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/interactions/Event_start.xml b/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/interactions/Event_start.xml deleted file mode 100644 index 5898a9e7ee2b1ab5a7b71cc7da202ba6435d2d40..0000000000000000000000000000000000000000 --- a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/interactions/Event_start.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="InteractionDefinition" module="Products.ERP5.Interaction"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>actbox_category</string> </key> - <value> <string>workflow</string> </value> - </item> - <item> - <key> <string>actbox_name</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>actbox_url</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>activate_script_name</string> </key> - <value> - <list> - <string>ShortMessage_send</string> - </list> - </value> - </item> - <item> - <key> <string>after_script_name</string> </key> - <value> - <tuple/> - </value> - </item> - <item> - <key> <string>before_commit_script_name</string> </key> - <value> - <tuple/> - </value> - </item> - <item> - <key> <string>description</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>guard</string> </key> - <value> - <none/> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>Event_start</string> </value> - </item> - <item> - <key> <string>method_id</string> </key> - <value> - <list> - <string>start</string> - </list> - </value> - </item> - <item> - <key> <string>once_per_transaction</string> </key> - <value> <int>1</int> </value> - </item> - <item> - <key> <string>portal_type_filter</string> </key> - <value> - <none/> - </value> - </item> - <item> - <key> <string>script_name</string> </key> - <value> - <tuple/> - </value> - </item> - <item> - <key> <string>title</string> </key> - <value> <string>Send the sms when it\'s posted</string> </value> - </item> - <item> - <key> <string>trigger_type</string> </key> - <value> <int>2</int> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/scripts.xml b/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/scripts.xml deleted file mode 100644 index 072c8f6540c07806bee17a34c920ec09b2de1bd5..0000000000000000000000000000000000000000 --- a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/scripts.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="Scripts" module="Products.DCWorkflow.Scripts"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>_mapping</string> </key> - <value> - <dictionary/> - </value> - </item> - <item> - <key> <string>_objects</string> </key> - <value> - <tuple/> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>scripts</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/scripts/ShortMessage_send.py b/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/scripts/ShortMessage_send.py deleted file mode 100644 index 36669397b6ef1e7aa183f5a0a637718f81b6f70e..0000000000000000000000000000000000000000 --- a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/scripts/ShortMessage_send.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Call send on the message""" -message = state_change['object'] -message.send(**state_change.kwargs) diff --git a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/scripts/ShortMessage_send.xml b/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/scripts/ShortMessage_send.xml deleted file mode 100644 index 3f302ec7acb47f6032dcdbb022292e015400ee22..0000000000000000000000000000000000000000 --- a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/scripts/ShortMessage_send.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?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>state_change</string> </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>ShortMessage_send</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/variables.xml b/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/variables.xml deleted file mode 100644 index 6ae03699d19840ac42b097dfc0a5f34edd416170..0000000000000000000000000000000000000000 --- a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/variables.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="Variables" module="Products.DCWorkflow.Variables"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>_mapping</string> </key> - <value> - <dictionary/> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>variables</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/worklists.xml b/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/worklists.xml deleted file mode 100644 index c3432aa051eac2d67ec0692a384adb38d1b6bac8..0000000000000000000000000000000000000000 --- a/bt5/erp5_short_message/WorkflowTemplateItem/portal_workflow/short_message_interaction_workflow/worklists.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="Worklists" module="Products.DCWorkflow.Worklists"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>_mapping</string> </key> - <value> - <dictionary/> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>worklists</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/bt5/erp5_short_message/bt/description b/bt5/erp5_short_message/bt/description index 33c6eb6175c0d29acf188453f1c275b0a2e21b5e..89e4b2c26a2b014f0d2655a0a7a9e87622b71b06 100644 --- a/bt5/erp5_short_message/bt/description +++ b/bt5/erp5_short_message/bt/description @@ -1 +1 @@ -Experimental BT to provide Short Message Service in ERP5 \ No newline at end of file +Provides Short Message Service in ERP5 \ No newline at end of file diff --git a/bt5/erp5_short_message/bt/template_workflow_id_list b/bt5/erp5_short_message/bt/template_workflow_id_list deleted file mode 100644 index cc7de01fd3b766d9aa99caefeceb16b9825854f5..0000000000000000000000000000000000000000 --- a/bt5/erp5_short_message/bt/template_workflow_id_list +++ /dev/null @@ -1 +0,0 @@ -short_message_interaction_workflow \ No newline at end of file