Commit aed0c449 authored by Julien Muchembled's avatar Julien Muchembled

Fix Document.getRevision when 'edit_workflow' or 'processing_status_workflow'...

Fix Document.getRevision when 'edit_workflow' or 'processing_status_workflow' doesn't exit in portal_workflow.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27936 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9c48705e
......@@ -791,10 +791,11 @@ class Document(PermanentURLMixIn, XMLObject, UrlMixIn, ConversionCacheMixin, Sna
in order to be consistent with the property sheet
definition.
"""
revision = len(self.getWorkflowInfo('history', 'edit_workflow'))
getInfoFor = getToolByName(self, 'portal_workflow').getInfoFor
revision = len(getInfoFor(self, 'history', (), 'edit_workflow'))
# XXX Also look at processing_status_workflow for compatibility.
for history_item in self.getWorkflowInfo('history',
'processing_status_workflow'):
for history_item in getInfoFor(self, 'history', (),
'processing_status_workflow'):
if history_item.get('action') == 'edit':
revision += 1
return str(revision)
......
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