Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
059f0651
Commit
059f0651
authored
Mar 27, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5ShortMessage: record in workflow that gateway could send SMS
parent
f5792613
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
bt5/erp5_short_message/SkinTemplateItem/portal_skins/erp5_short_message/SMSTool_afterSend.py
...Item/portal_skins/erp5_short_message/SMSTool_afterSend.py
+7
-1
product/ERP5ShortMessage/tests/testShortMessage.py
product/ERP5ShortMessage/tests/testShortMessage.py
+2
-0
No files found.
bt5/erp5_short_message/SkinTemplateItem/portal_skins/erp5_short_message/SMSTool_afterSend.py
View file @
059f0651
"""Save the message id of the relative document"""
"""Save the message id on the event and mark the message as stopped
"""
from
Products.ERP5Type.Message
import
translateString
if
document_relative_url
:
if
document_relative_url
:
document
=
context
.
getPortalObject
().
restrictedTraverse
(
document_relative_url
)
document
=
context
.
getPortalObject
().
restrictedTraverse
(
document_relative_url
)
document
.
edit
(
destination_reference
=
message_id
,
document
.
edit
(
destination_reference
=
message_id
,
gateway
=
gateway_relative_url
)
gateway
=
gateway_relative_url
)
if
document
.
getSimulationState
()
==
'started'
:
document
.
stop
(
comment
=
translateString
(
'Confirmed by gateway as ${message_id}'
,
mapping
=
{
'message_id'
:
message_id
}))
product/ERP5ShortMessage/tests/testShortMessage.py
View file @
059f0651
...
@@ -96,3 +96,5 @@ class TestShortMessageSending(ShortMessageTestCase):
...
@@ -96,3 +96,5 @@ class TestShortMessageSending(ShortMessageTestCase):
# sending message should have updated the document with message id and gateway
# sending message should have updated the document with message id and gateway
self
.
assertTrue
(
short_message
.
getDestinationReference
())
self
.
assertTrue
(
short_message
.
getDestinationReference
())
self
.
assertEqual
(
gateway
,
short_message
.
getGatewayValue
())
self
.
assertEqual
(
gateway
,
short_message
.
getGatewayValue
())
# if gateway confirm, the short message becomes stopped
self
.
assertEqual
(
'stopped'
,
short_message
.
getSimulationState
())
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