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
Lukas Niegsch
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,
...
@@ -3212,20 +3212,20 @@ class Base( CopyContainer,
"""
"""
Returns the creation date of the document based on workflow information
Returns the creation date of the document based on workflow information
"""
"""
# Check if edit_workflow defined
try
:
portal_workflow
=
self
.
getPortalObject
().
portal_workflow
history_list
=
aq_base
(
self
).
workflow_history
wf
=
portal_workflow
.
getWorkflowById
(
'edit_workflow'
)
except
AttributeError
:
wf_list
=
portal_workflow
.
getWorkflowsFor
(
self
)
pass
if
wf
is
not
None
:
else
:
wf_list
=
[
wf
]
+
wf_list
for
wf
in
wf_list
:
try
:
try
:
history
=
wf
.
getInfoFor
(
self
,
'history'
,
None
)
return
history_list
[
'edit_workflow'
][
0
][
'time'
]
except
KeyError
:
except
LookupError
:
history
=
None
try
:
if
history
is
not
None
and
len
(
history
):
return
min
(
history
[
0
][
'time'
]
# Then get the first line of edit_workflow
for
history
in
history_list
.
itervalues
()
return
history
[
0
].
get
(
'time'
,
None
)
if
history
)
except
ValueError
:
pass
if
getattr
(
aq_base
(
self
),
'CreationDate'
,
None
)
is
not
None
:
if
getattr
(
aq_base
(
self
),
'CreationDate'
,
None
)
is
not
None
:
return
asDate
(
self
.
CreationDate
())
return
asDate
(
self
.
CreationDate
())
return
None
# JPS-XXX - try to find a way to return a creation date instead of None
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