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
Klaus Wölfel
erp5
Commits
0c5fe26d
Commit
0c5fe26d
authored
Nov 30, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small optimization of SimulationMovement.getExplanationValue
parent
0be3a11a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
product/ERP5/Document/SimulationMovement.py
product/ERP5/Document/SimulationMovement.py
+10
-12
No files found.
product/ERP5/Document/SimulationMovement.py
View file @
0c5fe26d
...
...
@@ -373,8 +373,8 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
"""Returns the delivery if any or the order related to the root
applied rule if any.
"""
delivery
_value
=
self
.
getDeliveryValue
()
if
delivery
_value
is
None
:
explanation
_value
=
self
.
getDeliveryValue
()
if
explanation
_value
is
None
:
# If the parent is not an Applied Rule, self does not have the method.
getRootAppliedRule
=
getattr
(
self
,
'getRootAppliedRule'
,
None
)
if
getRootAppliedRule
is
None
:
...
...
@@ -386,16 +386,14 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
else
:
# Ex. zero stock rule
return
ra
else
:
explanation_value
=
delivery_value
portal
=
self
.
getPortalObject
()
delivery_type_list
=
self
.
getPortalDeliveryTypeList
()
\
+
self
.
getPortalOrderTypeList
()
while
explanation_value
.
getPortalType
()
not
in
delivery_type_list
and
\
explanation_value
!=
portal
:
explanation_value
=
explanation_value
.
getParentValue
()
if
explanation_value
!=
portal
:
return
explanation_value
portal
=
self
.
getPortalObject
()
delivery_type_list
=
portal
.
getPortalDeliveryTypeList
()
\
+
portal
.
getPortalOrderTypeList
()
while
explanation_value
.
getPortalType
()
not
in
delivery_type_list
:
explanation_value
=
explanation_value
.
getParentValue
()
if
explanation_value
==
portal
:
return
return
explanation_value
# Deliverability / orderability
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
...
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