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
Nicolas Wavrant
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,
...
@@ -819,18 +819,17 @@ class Delivery(XMLObject, ImmobilisationDelivery,
exclude_rule_path : do not expand this applied rule (or children
exclude_rule_path : do not expand this applied rule (or children
applied rule)
applied rule)
"""
"""
if
excluded_rule_path_list
is
None
:
excluded_rule_path_list
=
set
(
excluded_rule_path_list
or
())
excluded_rule_path_list
=
[]
to_expand
=
sorted
(
set
(
sm
.
getParentValue
()
to_expand_list
=
[]
for
sm
in
self
.
_getAllRelatedSimulationMovementList
()
for
sim_movement
in
self
.
_getAllRelatedSimulationMovementList
():
if
sm
.
getRootAppliedRule
().
getPath
()
not
in
excluded_rule_path_list
),
if
sim_movement
.
getRootAppliedRule
().
getPath
()
\
key
=
lambda
x
:
x
.
getRelativeUrl
())
not
in
excluded_rule_path_list
:
prev_ar
=
None
parent_value
=
sim_movement
.
getParentValue
()
for
ar
in
to_expand
:
if
parent_value
not
in
to_expand_list
:
if
not
ar
.
aq_inContextOf
(
prev_ar
):
to_expand_list
.
append
(
parent_value
)
ar
.
expand
(
activate_kw
=
activate_kw
,
**
kw
)
for
rule
in
to_expand_list
:
ar
.
recursiveReindexSimulationMovement
(
activate_kw
=
activate_kw
)
rule
.
expand
(
activate_kw
=
activate_kw
,
**
kw
)
prev_ar
=
ar
rule
.
recursiveReindexSimulationMovement
(
activate_kw
=
activate_kw
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getRootCausalityValueList'
)
'getRootCausalityValueList'
)
...
@@ -966,14 +965,11 @@ class Delivery(XMLObject, ImmobilisationDelivery,
...
@@ -966,14 +965,11 @@ class Delivery(XMLObject, ImmobilisationDelivery,
return
disconnected_simulation_movement_list
return
disconnected_simulation_movement_list
def
_getAllRelatedSimulationMovementList
(
self
,
**
kw
):
def
_getAllRelatedSimulationMovementList
(
self
,
**
kw
):
search_method
=
\
self
.
getPortalObject
().
portal_catalog
.
unrestrictedSearchResults
movement_uid_list
=
[
x
.
getUid
()
for
x
in
self
.
getMovementList
()]
movement_uid_list
=
[
x
.
getUid
()
for
x
in
self
.
getMovementList
()]
if
len
(
movement_uid_list
)
==
0
:
return
movement_uid_list
and
\
return
[]
self
.
getPortalObject
().
portal_catalog
.
unrestrictedSearchResults
(
sim_movement_list
=
search_method
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
delivery_uid
=
movement_uid_list
,
**
kw
)
delivery_uid
=
movement_uid_list
,
**
kw
)
return
sim_movement_list
def
getDivergentTesterAndSimulationMovementList
(
self
):
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