From a6a1fd58e9c6c273870dd83404dce2b5c36832ef Mon Sep 17 00:00:00 2001
From: Alexandre Boeglin <alex@nexedi.com>
Date: Wed, 12 Mar 2008 17:38:57 +0000
Subject: [PATCH] An order line or delivery line that contains movements should
 not be considered as a movement itself.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19834 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/DeliveryLine.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/product/ERP5/Document/DeliveryLine.py b/product/ERP5/Document/DeliveryLine.py
index 4fe114cb8b..f3306804d5 100644
--- a/product/ERP5/Document/DeliveryLine.py
+++ b/product/ERP5/Document/DeliveryLine.py
@@ -182,6 +182,15 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
       # cell, which define the same variated resource.
 #       return XMLMatrix.hasCellContent(self, base_id=base_id)
 
+    security.declareProtected( Permissions.AccessContentsInformation,
+        'isMovement' )
+    def isMovement(self):
+      """
+      returns true is the object contains no submovement (line or cell)
+      """
+      portal_type = self.getPortalMovementTypeList()
+      return len(self.contentValues(filter={'portal_type': portal_type})) == 0
+
     security.declareProtected( Permissions.AccessContentsInformation, 'getCellValueList' )
     def getCellValueList(self, base_id='movement'):
       """
-- 
2.30.9