From c59e9360f316ebba5af9a6f5a06b7aeebbba5679 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Mon, 22 Sep 2008 08:16:54 +0000
Subject: [PATCH] make hasLineContent() faster.

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

diff --git a/product/ERP5/Document/OrderLine.py b/product/ERP5/Document/OrderLine.py
index 77cd46011a..a60310c98b 100644
--- a/product/ERP5/Document/OrderLine.py
+++ b/product/ERP5/Document/OrderLine.py
@@ -76,7 +76,12 @@ class OrderLine(DeliveryLine):
       try:
         result = transactional_variable[call_method_key]
       except KeyError:
-        result = len(self.contentValues(meta_type=self.meta_type)) > 0
+        result = False
+        meta_type = self.meta_type
+        for i in self.objectValues():
+          if i.meta_type==meta_type:
+            result = True
+            break
         transactional_variable[call_method_key] = result
       return result
 
-- 
2.30.9