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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5
Commits
c6b48d38
Commit
c6b48d38
authored
Oct 04, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up getCreationDate
/reviewed-on
nexedi/erp5!934
parent
2e8be7fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+13
-13
No files found.
product/ERP5Type/Base.py
View file @
c6b48d38
...
...
@@ -3212,20 +3212,20 @@ class Base( CopyContainer,
"""
Returns the creation date of the document based on workflow information
"""
# Check if edit_workflow defined
portal_workflow
=
self
.
getPortalObject
().
portal_workflow
wf
=
portal_workflow
.
getWorkflowById
(
'edit_workflow'
)
wf_list
=
portal_workflow
.
getWorkflowsFor
(
self
)
if
wf
is
not
None
:
wf_list
=
[
wf
]
+
wf_list
for
wf
in
wf_list
:
try
:
history_list
=
aq_base
(
self
).
workflow_history
except
AttributeError
:
pass
else
:
try
:
history
=
wf
.
getInfoFor
(
self
,
'history'
,
None
)
except
KeyError
:
history
=
None
if
history
is
not
None
and
len
(
history
):
# Then get the first line of edit_workflow
return
history
[
0
].
get
(
'time'
,
None
)
return
history_list
[
'edit_workflow'
][
0
][
'time'
]
except
LookupError
:
try
:
return
min
(
history
[
0
][
'time'
]
for
history
in
history_list
.
itervalues
()
if
history
)
except
ValueError
:
pass
if
getattr
(
aq_base
(
self
),
'CreationDate'
,
None
)
is
not
None
:
return
asDate
(
self
.
CreationDate
())
return
None
# JPS-XXX - try to find a way to return a creation date instead of None
...
...
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