Commit fb5c4b9b authored by Jérome Perrin's avatar Jérome Perrin

don't use deprecated portal_ids API and call setters instead of edit

Because edit adds a line in workflow_history
parent fc05b33b
...@@ -63,14 +63,12 @@ short_portal_type = type_definition.getShortTitle()\n ...@@ -63,14 +63,12 @@ short_portal_type = type_definition.getShortTitle()\n
if not short_portal_type:\n if not short_portal_type:\n
short_portal_type = \'\'.join(s for s in type_definition.getId() if s.isupper())\n short_portal_type = \'\'.join(s for s in type_definition.getId() if s.isupper())\n
\n \n
id_group = (\'reference\', short_portal_type)\n new_id = portal.portal_ids.generateNewId(id_group=repr((\'reference\', short_portal_type)), default=1)\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 reference = \'%s-%s\' % (short_portal_type, new_id)\n
\n \n
# Set preferred text format and reference\n # Set preferred text format and reference\n
context.edit(content_type=context.portal_preferences.getPreferredTextFormat(),\n context.setContentType(context.portal_preferences.getPreferredTextFormat())\n
reference=reference)\n context.setReference(reference)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
651 652
\ 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