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
Richard
erp5
Commits
e2e4f433
Commit
e2e4f433
authored
Feb 05, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isDivergent: fix docstring and return a boolean
parent
d16118b7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
40 deletions
+15
-40
product/ERP5/Document/Container.py
product/ERP5/Document/Container.py
+3
-7
product/ERP5/Document/ContainerCell.py
product/ERP5/Document/ContainerCell.py
+3
-8
product/ERP5/Document/ContainerLine.py
product/ERP5/Document/ContainerLine.py
+3
-8
product/ERP5/Document/Delivery.py
product/ERP5/Document/Delivery.py
+5
-10
product/ERP5/Document/Movement.py
product/ERP5/Document/Movement.py
+1
-7
No files found.
product/ERP5/Document/Container.py
View file @
e2e4f433
...
...
@@ -103,14 +103,10 @@ class Container(Movement, XMLObject):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
def
isDivergent
(
self
):
"""Return True if this movement diverges from the its simulation.
Containers are never divergent.
"""
Returns 1 if the target is not met according to the current information
After and edit, the isOutOfTarget will be checked. If it is 1,
a message is emitted
emit targetUnreachable !
"""
return
0
return
False
def
getContainerText
(
self
):
"""
...
...
product/ERP5/Document/ContainerCell.py
View file @
e2e4f433
...
...
@@ -72,12 +72,7 @@ class ContainerCell(DeliveryCell):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
def
isDivergent
(
self
):
"""Return True if this movement diverges from the its simulation.
Container Cells are never divergent.
"""
Returns 1 if the target is not met according to the current information
After and edit, the isOutOfTarget will be checked. If it is 1,
a message is emitted
emit targetUnreachable !
"""
# Never divergent
return
0
return
False
product/ERP5/Document/ContainerLine.py
View file @
e2e4f433
...
...
@@ -81,15 +81,10 @@ class ContainerLine(DeliveryLine):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
def
isDivergent
(
self
):
"""Return True if this movement diverges from the its simulation.
Container Lines are never divergent.
"""
Returns 1 if the target is not met according to the current information
After and edit, the isOutOfTarget will be checked. If it is 1,
a message is emitted
emit targetUnreachable !
"""
# Never divergent
return
0
return
False
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTotalQuantity'
)
def
getTotalQuantity
(
self
):
...
...
product/ERP5/Document/Delivery.py
View file @
e2e4f433
...
...
@@ -334,7 +334,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
"""
Returns 0 if the target is not met
"""
return
int
(
not
self
.
isDivergent
(
**
kw
))
return
bool
(
not
self
.
isDivergent
(
**
kw
))
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isSimulated'
)
def
isSimulated
(
self
):
...
...
@@ -349,20 +349,15 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
def
isDivergent
(
self
,
fast
=
0
,
**
kw
):
"""
Returns 1 if the target is not met according to the current information
After and edit, the isOutOfTarget will be checked. If it is 1,
a message is emitted
emit targetUnreachable !
"""Return True if this movement diverges from the its simulation.
"""
## Note that fast option was removed. Now, fast=1 is ignored.
# Check if the total quantity equals the total of each simulation movement quantity
for
simulation_movement
in
self
.
_getAllRelatedSimulationMovementList
():
if
simulation_movement
.
isDivergent
():
return
1
return
0
return
True
return
False
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getDivergenceList'
)
def
getDivergenceList
(
self
,
**
kw
):
...
...
product/ERP5/Document/Movement.py
View file @
e2e4f433
...
...
@@ -488,13 +488,7 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
def
isDivergent
(
self
):
"""
XXX documentation out of sync with actual use
Returns 1 if the target is not met according to the current information
After and edit, the isOutOfTarget will be checked. If it is 1,
a message is emitted
emit targetUnreachable !
"""Return True if this movement diverges from the its simulation.
"""
for
simulation_movement
in
self
.
getDeliveryRelatedValueList
():
if
simulation_movement
.
isDivergent
():
...
...
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