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
Laurent S
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):
...
@@ -103,14 +103,10 @@ class Container(Movement, XMLObject):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
def
isDivergent
(
self
):
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
return
False
After and edit, the isOutOfTarget will be checked. If it is 1,
a message is emitted
emit targetUnreachable !
"""
return
0
def
getContainerText
(
self
):
def
getContainerText
(
self
):
"""
"""
...
...
product/ERP5/Document/ContainerCell.py
View file @
e2e4f433
...
@@ -72,12 +72,7 @@ class ContainerCell(DeliveryCell):
...
@@ -72,12 +72,7 @@ class ContainerCell(DeliveryCell):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
def
isDivergent
(
self
):
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
return
False
After and edit, the isOutOfTarget will be checked. If it is 1,
a message is emitted
emit targetUnreachable !
"""
# Never divergent
return
0
product/ERP5/Document/ContainerLine.py
View file @
e2e4f433
...
@@ -81,15 +81,10 @@ class ContainerLine(DeliveryLine):
...
@@ -81,15 +81,10 @@ class ContainerLine(DeliveryLine):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
def
isDivergent
(
self
):
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
return
False
After and edit, the isOutOfTarget will be checked. If it is 1,
a message is emitted
emit targetUnreachable !
"""
# Never divergent
return
0
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTotalQuantity'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTotalQuantity'
)
def
getTotalQuantity
(
self
):
def
getTotalQuantity
(
self
):
...
...
product/ERP5/Document/Delivery.py
View file @
e2e4f433
...
@@ -334,7 +334,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
...
@@ -334,7 +334,7 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
"""
"""
Returns 0 if the target is not met
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'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isSimulated'
)
def
isSimulated
(
self
):
def
isSimulated
(
self
):
...
@@ -349,20 +349,15 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
...
@@ -349,20 +349,15 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
def
isDivergent
(
self
,
fast
=
0
,
**
kw
):
def
isDivergent
(
self
,
fast
=
0
,
**
kw
):
"""
"""Return True if this movement diverges from the its simulation.
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 !
"""
"""
## Note that fast option was removed. Now, fast=1 is ignored.
## Note that fast option was removed. Now, fast=1 is ignored.
# Check if the total quantity equals the total of each simulation movement quantity
# Check if the total quantity equals the total of each simulation movement quantity
for
simulation_movement
in
self
.
_getAllRelatedSimulationMovementList
():
for
simulation_movement
in
self
.
_getAllRelatedSimulationMovementList
():
if
simulation_movement
.
isDivergent
():
if
simulation_movement
.
isDivergent
():
return
1
return
True
return
0
return
False
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getDivergenceList'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getDivergenceList'
)
def
getDivergenceList
(
self
,
**
kw
):
def
getDivergenceList
(
self
,
**
kw
):
...
...
product/ERP5/Document/Movement.py
View file @
e2e4f433
...
@@ -488,13 +488,7 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
...
@@ -488,13 +488,7 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'isDivergent'
)
'isDivergent'
)
def
isDivergent
(
self
):
def
isDivergent
(
self
):
"""
"""Return True if this movement diverges from the its simulation.
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 !
"""
"""
for
simulation_movement
in
self
.
getDeliveryRelatedValueList
():
for
simulation_movement
in
self
.
getDeliveryRelatedValueList
():
if
simulation_movement
.
isDivergent
():
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