From 4c0c52a8759b4a79da01760a876e1f73307e1c08 Mon Sep 17 00:00:00 2001 From: Nicolas Dumazet <nicolas.dumazet@nexedi.com> Date: Tue, 7 Dec 2010 02:37:03 +0000 Subject: [PATCH] specify an id to avoid duplicates git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41179 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/ERP5Type.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/product/ERP5Type/ERP5Type.py b/product/ERP5Type/ERP5Type.py index 46201c4e24..c04c85a693 100644 --- a/product/ERP5Type/ERP5Type.py +++ b/product/ERP5Type/ERP5Type.py @@ -211,6 +211,7 @@ class ERP5TypeInformation(XMLObject, acquire_local_roles = False property_sheet_list = () + zodb_property_sheet_list = () base_category_list = () init_script = '' product = 'ERP5Type' @@ -346,8 +347,6 @@ class ERP5TypeInformation(XMLObject, ob = klass(id) if temp_object: - if id in (None, ''): - raise ValueError("invalid object id") ob = ob.__of__(container) for ignore in ('activate_kw', 'is_indexable', 'reindex_kw'): kw.pop(ignore, None) @@ -376,7 +375,10 @@ class ERP5TypeInformation(XMLObject, #ob._setPortalTypeName(self.getId()) # XXX rafael: if we use _set because it is trigger by interaction # workflow and it is annoyning without security setted - ob.portal_type = self.getId() + try: + ob.portal_type = self.getId() + except: + import pdb; pdb.set_trace() if not temp_object: # Do not reindex object because it's already done by manage_afterAdd @@ -423,6 +425,12 @@ class ERP5TypeInformation(XMLObject, """Getter for 'type_property_sheet' property""" return list(self.property_sheet_list) + security.declareProtected(Permissions.AccessContentsInformation, + 'getTypeZodbPropertySheetList') + def getTypeZodbPropertySheetList(self): + """Getter for 'zodb_type_property_sheet' property""" + return list(self.zodb_property_sheet_list) + security.declareProtected(Permissions.AccessContentsInformation, 'getTypeBaseCategoryList') def getTypeBaseCategoryList(self): -- 2.30.9