From 246dbac338d5d5ce28e7cafa5713ae99f4c05ba3 Mon Sep 17 00:00:00 2001 From: Vincent Pelletier <vincent@nexedi.com> Date: Tue, 19 Feb 2008 09:31:35 +0000 Subject: [PATCH] Do not use objectIds to count the number of subobjects: it's very inefficient with btreefolders. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19380 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/BusinessTemplate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py index ecce6169f3..ee54f4cf00 100644 --- a/product/ERP5/Document/BusinessTemplate.py +++ b/product/ERP5/Document/BusinessTemplate.py @@ -4524,7 +4524,7 @@ Business Template is a set of definitions, such as skins, portal types and categ # always created a trash bin because we may to save object already present # but not in a previous business templates apart at creation of a new site - if trash_tool is not None and (len(object_to_update) > 0 or len(self.portal_templates.objectIds()) > 1): + if trash_tool is not None and (len(object_to_update) > 0 or len(self.portal_templates) > 1): trashbin = trash_tool.newTrashBin(self.getTitle(), self) else: trashbin = None @@ -4579,7 +4579,7 @@ Business Template is a set of definitions, such as skins, portal types and categ # remove trashbin if empty if trashbin is not None: - if len(trashbin.objectIds()) == 0: + if len(trashbin) == 0: trash_tool.manage_delObjects([trashbin.getId(),]) if update_catalog: -- 2.30.9