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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
e99e166f
Commit
e99e166f
authored
Dec 07, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up Delivery.expand by not expanding the same Applied Rule several times
parent
0c5fe26d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
product/ERP5/Document/Delivery.py
product/ERP5/Document/Delivery.py
+15
-19
No files found.
product/ERP5/Document/Delivery.py
View file @
e99e166f
...
...
@@ -819,18 +819,17 @@ class Delivery(XMLObject, ImmobilisationDelivery,
exclude_rule_path : do not expand this applied rule (or children
applied rule)
"""
if
excluded_rule_path_list
is
None
:
excluded_rule_path_list
=
[]
to_expand_list
=
[]
for
sim_movement
in
self
.
_getAllRelatedSimulationMovementList
():
if
sim_movement
.
getRootAppliedRule
().
getPath
()
\
not
in
excluded_rule_path_list
:
parent_value
=
sim_movement
.
getParentValue
()
if
parent_value
not
in
to_expand_list
:
to_expand_list
.
append
(
parent_value
)
for
rule
in
to_expand_list
:
rule
.
expand
(
activate_kw
=
activate_kw
,
**
kw
)
rule
.
recursiveReindexSimulationMovement
(
activate_kw
=
activate_kw
)
excluded_rule_path_list
=
set
(
excluded_rule_path_list
or
())
to_expand
=
sorted
(
set
(
sm
.
getParentValue
()
for
sm
in
self
.
_getAllRelatedSimulationMovementList
()
if
sm
.
getRootAppliedRule
().
getPath
()
not
in
excluded_rule_path_list
),
key
=
lambda
x
:
x
.
getRelativeUrl
())
prev_ar
=
None
for
ar
in
to_expand
:
if
not
ar
.
aq_inContextOf
(
prev_ar
):
ar
.
expand
(
activate_kw
=
activate_kw
,
**
kw
)
ar
.
recursiveReindexSimulationMovement
(
activate_kw
=
activate_kw
)
prev_ar
=
ar
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getRootCausalityValueList'
)
...
...
@@ -966,14 +965,11 @@ class Delivery(XMLObject, ImmobilisationDelivery,
return
disconnected_simulation_movement_list
def
_getAllRelatedSimulationMovementList
(
self
,
**
kw
):
search_method
=
\
self
.
getPortalObject
().
portal_catalog
.
unrestrictedSearchResults
movement_uid_list
=
[
x
.
getUid
()
for
x
in
self
.
getMovementList
()]
if
len
(
movement_uid_list
)
==
0
:
return
[]
sim_movement_list
=
search_method
(
portal_type
=
'Simulation Movement'
,
return
movement_uid_list
and
\
self
.
getPortalObject
().
portal_catalog
.
unrestrictedSearchResults
(
portal_type
=
'Simulation Movement'
,
delivery_uid
=
movement_uid_list
,
**
kw
)
return
sim_movement_list
def
getDivergentTesterAndSimulationMovementList
(
self
):
"""
...
...
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