Commit 336a8d63 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

create support request's reference just same as event's reference.

parent 79523eee
......@@ -50,9 +50,20 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Define Reference from ID\n
support_request_id = context.getId()\n
context.setReference("SR-%s" % support_request_id)\n
<value> <string># Define Reference from ID provided by portal_ids\n
portal = context.getPortalObject()\n
type_definition = context.getTypeInfo()\n
\n
short_portal_type = type_definition.getShortTitle()\n
if not short_portal_type:\n
short_portal_type = \'\'.join(s for s in type_definition.getId() if s.isupper())\n
\n
id_group = (\'reference\', short_portal_type)\n
default = 1\n
new_id = portal.portal_ids.generateNewId(id_group=id_group, default=default)\n
reference = \'%s-%s\' % (short_portal_type, new_id)\n
\n
context.setReference(reference)\n
</string> </value>
</item>
<item>
......
567
\ No newline at end of file
568
\ 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