From 1045512ff8b24946782e196ef256a4b2374a7d25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Fri, 15 Sep 2006 11:19:10 +0000
Subject: [PATCH] remove empty trash bin at the end of installation

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

diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py
index a4c29ccfb1..52cde9695c 100644
--- a/product/ERP5/Document/BusinessTemplate.py
+++ b/product/ERP5/Document/BusinessTemplate.py
@@ -4047,7 +4047,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
         LOG('Business Template', 0, 'Updating Tools')
         gen.setup(site, 0, update=1)
 
-      # check if we have to updater business template workflow
+      # check if we have to update business template workflow
       if self.getTitle() == 'erp5_core' and self.getTemplateUpdateBusinessTemplateWorkflow():
         LOG('Business Template', 0, 'Updating Business Template Workflows')
         gen.setupWorkflow(site)
@@ -4055,6 +4055,11 @@ Business Template is a set of definitions, such as skins, portal types and categ
         #         self._v_txn = WorkflowUpdateTM()
         #         self._v_txn.register(update=1, gen=gen, site=site)
 
+      # remove trashbin if empty
+      if trashbin is not None:
+        if len(trashbin.objectIds()) == 0:
+          trash_tool.manage_delObjects([trashbin.getId(),])
+
       if update_catalog:
         site.ERP5Site_reindexAll()
 
-- 
2.30.9