From caa83aa1c9705b1f50ebc67b6264187ba8a2b534 Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Thu, 18 Dec 2003 00:13:40 +0000 Subject: [PATCH] Renamed to isSimulated git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@131 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/Delivery.py | 7 +++++++ product/ERP5/Document/DeliveryLine.py | 4 ++-- product/ERP5/Document/Movement.py | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/product/ERP5/Document/Delivery.py b/product/ERP5/Document/Delivery.py index 81075663dc..5f726bdfd9 100755 --- a/product/ERP5/Document/Delivery.py +++ b/product/ERP5/Document/Delivery.py @@ -490,6 +490,13 @@ une liste de mouvements...""" """ return not self.isDivergent() + security.declareProtected(Permissions.View, 'isSimulated') + def isSimulated(self): + for m in self.getMovementList(): + if not m.isSimulated(): + return 0 + return 1 + security.declareProtected(Permissions.View, 'isDivergent') def isDivergent(self): """ diff --git a/product/ERP5/Document/DeliveryLine.py b/product/ERP5/Document/DeliveryLine.py index bcabb633b3..db4ff9f2d7 100755 --- a/product/ERP5/Document/DeliveryLine.py +++ b/product/ERP5/Document/DeliveryLine.py @@ -309,10 +309,10 @@ Une ligne tarifaire.""" for cell in self.contentValues(filter={'portal_type': 'Delivery Cell'}): if cell.isDivergent(): return 1 - if not cell.hasSimulationMovement(): + if not cell.isSimulated(): return 1 else: - return Movement.isDivergent(self) or (not self.hasSimulationMovement()) + return Movement.isDivergent(self) or (not self.isSimulated()) security.declareProtected(Permissions.ModifyPortalContent, 'applyTargetSolver') def applyTargetSolver(self, solver): diff --git a/product/ERP5/Document/Movement.py b/product/ERP5/Document/Movement.py index 827de929e8..a314de3d69 100755 --- a/product/ERP5/Document/Movement.py +++ b/product/ERP5/Document/Movement.py @@ -421,7 +421,7 @@ a service in a public administration).""" return self.getDeliveryValue() # Simulation - security.declareProtected(Permissions.View, 'hasSimulationMovement') - self hasSimulationMovement(self): + security.declareProtected(Permissions.View, 'isSimulated') + def isSimulated(self): return len(self.getDeliveryRelatedValueList()) > 0 or len(self.getOrderRelatedValueList()) > 0 -- 2.30.9