Commit b56f9771 authored by Sebastien Robin's avatar Sebastien Robin

sorry, forgot to specify file in previous commit


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3769 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 11906fae
......@@ -253,7 +253,7 @@ class Delivery(XMLObject):
return 1
security.declareProtected(Permissions.View, 'isDivergent')
def isDivergent(self,**kw):
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,
......@@ -264,15 +264,13 @@ class Delivery(XMLObject):
# Delivery_zIsDivergent only works when object and simulation is
# reindexed, so if an user change the delivery, he must wait
# until everything is indexed, this is not acceptable for users
# So the user should be warned with a state of calcul
# so we should not use it by default (and may be we should remove)
if len(self.Delivery_zIsDivergent(uid=self.getUid())) > 0:
if fast==1 and len(self.Delivery_zIsDivergent(uid=self.getUid())) > 0:
return 1
# Check if the total quantity equals the total of each simulation movement quantity
# This should not be used because this is too slow
#for movement in self.getMovementList():
# if movement.isDivergent():
# return 1
for movement in self.getMovementList():
if movement.isDivergent():
return 1
return 0
#######################################################
......
......@@ -202,11 +202,8 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated):
emit targetUnreachable !
"""
LOG('Line.isDivergent, self.getPath',0,self.getPath())
if self.hasCellContent():
for cell in self.contentValues(filter={'portal_type': 'Delivery Cell'}):
LOG('Line.isDivergent, cell.getPath',0,cell.getPath())
LOG('Line.isDivergent, cell.isDivergent',0,cell.isDivergent())
if cell.isDivergent():
return 1
else:
......
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