From 50eb451aef0bddfc1e8256deb83c7463b3f30469 Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Mon, 19 Jul 2010 07:13:39 +0000
Subject: [PATCH] Temp objects do not have portal_type definition so in case
 getSearchableText is called on them use 'Base Type' one.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37178 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Base.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py
index 82832f9f0a..9b95606275 100644
--- a/product/ERP5Type/Base.py
+++ b/product/ERP5Type/Base.py
@@ -3201,6 +3201,10 @@ class Base( CopyContainer,
       """
       searchable_text_list = []
       portal_type = self.portal_types.getTypeInfo(self)
+      if portal_type is None and self.isTempDocument():
+        # if it's a temp object we have no portal_type definition
+        # so use definition of 'Base Type' for searchable methods & properties
+        portal_type = self.portal_types.getTypeInfo('Base Type')
       searchable_text_method_id_list = []
       # generated from properties methods and add explicitly defined method_ids as well 
       for searchable_text_property_id in portal_type.getSearchableTextPropertyIdList():
-- 
2.30.9