Commit 8df1709c authored by Romain Courteaud's avatar Romain Courteaud

Rewrite isDivergent, because target values are not used anymore.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3193 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 51a71e19
...@@ -328,7 +328,7 @@ class Movement(XMLObject, Amount): ...@@ -328,7 +328,7 @@ class Movement(XMLObject, Amount):
""" """
Returns 0 if the target is not met Returns 0 if the target is not met
""" """
return not self.isDivergent() return int(not self.isDivergent())
security.declareProtected(Permissions.View, 'isDivergent') security.declareProtected(Permissions.View, 'isDivergent')
def isDivergent(self): def isDivergent(self):
...@@ -339,13 +339,7 @@ class Movement(XMLObject, Amount): ...@@ -339,13 +339,7 @@ class Movement(XMLObject, Amount):
emit targetUnreachable ! emit targetUnreachable !
""" """
if self.getStartDate() is None or self.getTargetStartDate() is None \ return 0
or self.getStopDate() is None or self.getTargetStopDate() is None:
return 1
# This is uggly but required due to python2.2/2.3 Zope 2.6/2.7 inconsistency in _millis calculation
return self.getQuantity() != self.getTargetQuantity() or \
self.getStartDate().Date() != self.getTargetStartDate().Date() or \
self.getStopDate().Date() != self.getTargetStopDate().Date()
# XXX moved to portal simulation # XXX moved to portal simulation
# # Solver # # Solver
...@@ -646,4 +640,4 @@ class Movement(XMLObject, Amount): ...@@ -646,4 +640,4 @@ class Movement(XMLObject, Amount):
# #
# For accounting, returns the quantity converted in a default unit # For accounting, returns the quantity converted in a default unit
# """ # """
# return self.getStandardInventoriatedQuantity() # return self.getStandardInventoriatedQuantity()
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment