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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xueyun Qian
erp5
Commits
43b1ae1b
Commit
43b1ae1b
authored
Mar 12, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Directly use WorkflowTool to access time value.
parent
1ec72363
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+11
-10
No files found.
product/ERP5Type/Base.py
View file @
43b1ae1b
...
...
@@ -102,6 +102,8 @@ import zope.interface
from
ZODB.POSException
import
ConflictError
from
zLOG
import
LOG
,
INFO
,
ERROR
,
WARNING
from
DateTime
import
DateTime
_MARKER
=
[]
global
registered_workflow_method_set
...
...
@@ -3163,22 +3165,21 @@ class Base( CopyContainer,
portal_workflow
=
getToolByName
(
self
.
getPortalObject
(),
'portal_workflow'
)
wf
=
portal_workflow
.
getWorkflowById
(
'edit_workflow'
)
wf_list
=
list
(
portal_workflow
.
getWorkflowsFor
(
self
))
getStatusOf
=
portal_workflow
.
getStatusOf
if
wf
is
not
None
:
wf_list
=
[
wf
]
+
wf_list
max_date
=
None
for
wf
in
wf_list
:
try
:
history
=
wf
.
getInfoFor
(
self
,
'history'
,
None
)
except
KeyError
:
history
=
None
# as WorkflowHistoryList.__len__ implementation has to walk whole
# workflow check that there is something in history in simpler way
if
isinstance
(
history
,
list
)
and
history
:
date
=
history
[
-
1
].
get
(
'time'
,
None
)
# Then get the last line of edit_workflow
status
=
getStatusOf
(
wf
.
id
,
self
)
if
status
is
not
None
and
status
.
has_key
(
'time'
):
date
=
status
[
'time'
]
if
date
>
max_date
:
max_date
=
date
return
max_date
# Return a copy of history time, to prevent modification
if
max_date
is
None
:
return
max_date
else
:
return
DateTime
(
max_date
)
# Layout management
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getApplicableLayout'
)
...
...
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