Commit ec5bc1e3 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Category Tool and Base Category portal types were missing

BaseAccessorHolder in their bases, thus related accessors were not
properly generated



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43121 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 713872c5
......@@ -111,10 +111,8 @@ class AccessorHolderType(type):
InitializeClass(accessor_holder_class)
return accessor_holder_class
generating_base_accessor_holder = False
def _generateBaseAccessorHolder(portal,
accessor_holder_module):
accessor_holder_module):
"""
Create once an accessor holder that contains all accessors common to
all portal types: erp5.accessor_holder.BaseAccessorHolder
......@@ -136,15 +134,9 @@ def _generateBaseAccessorHolder(portal,
if accessor_holder is not None:
return accessor_holder
global generating_base_accessor_holder
if generating_base_accessor_holder:
# can cause recursion, as accessing categories generates category properties
return None
generating_base_accessor_holder = True
# When setting up the site, there will be no portal_categories
portal_categories = getattr(portal, 'portal_categories', None)
if portal_categories is None:
generating_base_accessor_holder = False
return None
base_category_list = portal_categories.objectIds()
......@@ -163,7 +155,6 @@ def _generateBaseAccessorHolder(portal,
'erp5.accessor_holder',
initialize=False)
setattr(accessor_holder_module, base_accessor_holder_id, accessor_holder)
generating_base_accessor_holder = False
return accessor_holder
def _generatePreferenceToolAccessorHolder(portal, accessor_holder_list,
......@@ -212,4 +203,3 @@ def _generatePreferenceToolAccessorHolder(portal, accessor_holder_list,
initialize=False)
setattr(accessor_holder_module, 'PreferenceTool', accessor_holder)
return accessor_holder
......@@ -70,13 +70,10 @@ def _createAccessorHolderList(site,
accessor_holder_list = []
if "Base" in property_sheet_name_set:
accessor_holder_class = None
# useless if Base Category is not yet here or if we're currently
# generating accessors for Base Categories
if hasattr(erp5.accessor_holder, "BaseCategory"):
accessor_holder_class = _generateBaseAccessorHolder(site,
erp5.accessor_holder)
accessor_holder_class = _generateBaseAccessorHolder(site,
erp5.accessor_holder)
if accessor_holder_class is not None:
accessor_holder_list.append(accessor_holder_class)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment