diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py index ac86e1c618895c76c1c5d484b7c9d70cff5a2350..b00d36b00ca449d60e2a1fd7a4c6612cdc2f0c26 100644 --- a/product/ERP5/Document/BusinessTemplate.py +++ b/product/ERP5/Document/BusinessTemplate.py @@ -804,9 +804,11 @@ class ObjectTemplateItem(BaseTemplateItem): object_id = relative_url.split('/')[-1] try: container = portal.unrestrictedTraverse(container_path) - object = container[object_id] # We force access to the object to be sure - # that appropriate exception is thrown - # in case object is already backup and/or removed + if container.aq_parent.meta_type != 'ERP5 Catalog': + # __getitem__ on a catalog wait for an uid + object = container[object_id] # We force access to the object to be sure + # that appropriate exception is thrown + # in case object is already backup and/or removed if trash and trashbin is not None: self.portal_trash.backupObject(trashbin, container_path, object_id, save=1, keep_subobjects=1) container.manage_delObjects([object_id])