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
Leo Le Bouter
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):
...
@@ -373,8 +373,8 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
"""Returns the delivery if any or the order related to the root
"""Returns the delivery if any or the order related to the root
applied rule if any.
applied rule if any.
"""
"""
delivery
_value
=
self
.
getDeliveryValue
()
explanation
_value
=
self
.
getDeliveryValue
()
if
delivery
_value
is
None
:
if
explanation
_value
is
None
:
# If the parent is not an Applied Rule, self does not have the method.
# If the parent is not an Applied Rule, self does not have the method.
getRootAppliedRule
=
getattr
(
self
,
'getRootAppliedRule'
,
None
)
getRootAppliedRule
=
getattr
(
self
,
'getRootAppliedRule'
,
None
)
if
getRootAppliedRule
is
None
:
if
getRootAppliedRule
is
None
:
...
@@ -386,16 +386,14 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
...
@@ -386,16 +386,14 @@ class SimulationMovement(PropertyRecordableMixin, Movement, ExplainableMixin):
else
:
else
:
# Ex. zero stock rule
# Ex. zero stock rule
return
ra
return
ra
else
:
portal
=
self
.
getPortalObject
()
explanation_value
=
delivery_value
delivery_type_list
=
portal
.
getPortalDeliveryTypeList
()
\
portal
=
self
.
getPortalObject
()
+
portal
.
getPortalOrderTypeList
()
delivery_type_list
=
self
.
getPortalDeliveryTypeList
()
\
while
explanation_value
.
getPortalType
()
not
in
delivery_type_list
:
+
self
.
getPortalOrderTypeList
()
explanation_value
=
explanation_value
.
getParentValue
()
while
explanation_value
.
getPortalType
()
not
in
delivery_type_list
and
\
if
explanation_value
==
portal
:
explanation_value
!=
portal
:
return
explanation_value
=
explanation_value
.
getParentValue
()
return
explanation_value
if
explanation_value
!=
portal
:
return
explanation_value
# Deliverability / orderability
# Deliverability / orderability
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
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