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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
erp5
Commits
8c2f568d
Commit
8c2f568d
authored
Oct 12, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WF-PERF-HACK: try redefining getXXXList to avoid using category tool
parent
769ed8ce
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
3 deletions
+62
-3
product/ERP5/bootstrap/erp5_core/CategoryTemplateItem/portal_categories/destination.xml
...re/CategoryTemplateItem/portal_categories/destination.xml
+3
-1
product/ERP5Workflow/Document/Interaction.py
product/ERP5Workflow/Document/Interaction.py
+21
-1
product/ERP5Workflow/Document/State.py
product/ERP5Workflow/Document/State.py
+15
-0
product/ERP5Workflow/Document/Transition.py
product/ERP5Workflow/Document/Transition.py
+23
-1
No files found.
product/ERP5/bootstrap/erp5_core/CategoryTemplateItem/portal_categories/destination.xml
View file @
8c2f568d
...
...
@@ -32,6 +32,8 @@
<key>
<string>
acquisition_base_category
</string>
</key>
<value>
<tuple>
<string>
order
</string>
<string>
parent
</string>
</tuple>
</value>
</item>
...
...
@@ -51,7 +53,7 @@
</item>
<item>
<key>
<string>
acquisition_portal_type
</string>
</key>
<value>
<string>
python:
[]
</string>
</value>
<value>
<string>
python:
list( portal.getPortalAcquisitionMovementTypeList() + portal.getPortalItemTypeList() + portal.getPortalDeliveryTypeList() + portal.getPortalOrderTypeList() + portal.getPortalInvoiceTypeList() + portal.getPortalSupplyTypeList() + portal.getPortalSupplyPathTypeList() + portal.getPortalProjectTypeList() + portal.getPortalOpenOrderTypeList() + portal.getPortalCalendarTypeList())
</string>
</value>
</item>
<item>
<key>
<string>
acquisition_sync_value
</string>
</key>
...
...
product/ERP5Workflow/Document/Interaction.py
View file @
8c2f568d
...
...
@@ -114,4 +114,24 @@ class Interaction(IdAsReferenceMixin('interaction_', "prefix"), XMLObject,
"""
parent
=
self
.
getParentValue
()
return
[
parent
.
_getOb
(
transition_id
)
for
transition_id
in
self
.
getActivateScriptIdList
()]
\ No newline at end of file
in
self
.
getActivateScriptIdList
()]
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getActivateScriptList'
)
def
getActivateScriptList
(
self
):
"""
returns the list of activate script
"""
return
[
path
.
split
(
'/'
)[
-
1
]
for
path
in
self
.
getCategoryList
()
if
path
.
startswith
(
'activate_script'
)]
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getBeforeCommitScriptList'
)
def
getBeforeCommitScriptList
(
self
):
"""
returns the list of before commit script
"""
return
[
path
.
split
(
'/'
)[
-
1
]
for
path
in
self
.
getCategoryList
()
if
path
.
startswith
(
'before_commit_script'
)]
\ No newline at end of file
product/ERP5Workflow/Document/State.py
View file @
8c2f568d
...
...
@@ -90,6 +90,19 @@ class State(IdAsReferenceMixin("state_", "prefix"), XMLObject, CustomStorageMatr
possible_transition_list
.
append
(
tr_path
)
self
.
setCategoryList
(
possible_transition_list
)
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getDestinationList'
)
def
getDestinationList
(
self
):
"""
this getter is redefined to improve performance:
instead of getting all the transition objects from the destination list
to then use their ids, extract the information from the string
"""
return
[
path
.
split
(
'/'
)[
-
1
]
for
path
in
self
.
getCategoryList
()
if
path
.
startswith
(
'destination'
)]
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getDestinationIdList'
)
def
getDestinationIdList
(
self
):
...
...
@@ -100,6 +113,8 @@ class State(IdAsReferenceMixin("state_", "prefix"), XMLObject, CustomStorageMatr
"""
return
[
path
.
split
(
'/'
)[
-
1
]
for
path
in
self
.
getDestinationList
()]
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getDestinationValueList'
)
def
getDestinationValueList
(
self
):
"""
this getter is redefined to improve performance:
...
...
product/ERP5Workflow/Document/Transition.py
View file @
8c2f568d
...
...
@@ -82,6 +82,28 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject,
# they use the categories paths directly and string operations
# instead of traversing from the portal to get the objects
# in order to have their id or value
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getBeforeScriptList'
)
def
getBeforeScriptList
(
self
):
"""
returns the list of before script
"""
return
[
path
.
split
(
'/'
)[
-
1
]
for
path
in
self
.
getCategoryList
()
if
path
.
startswith
(
'before_script'
)]
# XXX(PERF): hack to see Category Tool responsability in new workflow slowness
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getAfterScriptList'
)
def
getAfterScriptList
(
self
):
"""
returns the list of after script
"""
return
[
path
.
split
(
'/'
)[
-
1
]
for
path
in
self
.
getCategoryList
()
if
path
.
startswith
(
'after_script'
)]
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getBeforeScriptIdList'
)
def
getBeforeScriptIdList
(
self
):
...
...
@@ -116,4 +138,4 @@ class Transition(IdAsReferenceMixin("transition_", "prefix"), XMLObject,
"""
parent
=
self
.
getParentValue
()
return
[
parent
.
_getOb
(
transition_id
)
for
transition_id
in
self
.
getAfterScriptIdList
()]
\ No newline at end of file
in
self
.
getAfterScriptIdList
()]
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