Commit ca8b7f4a authored by Jérome Perrin's avatar Jérome Perrin

Create related accessors for base categories defined on portal_types only.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5387 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3d719bd3
......@@ -428,7 +428,7 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
if not Base.aq_related_generated:
from Utils import createRelatedValueAccessors
generated = 1
portal_categories = getToolByName(self, 'portal_categories', None)
portal_types = getToolByName(self, 'portal_types', None)
generated_bid = {}
for pid, ps in PropertySheet.__dict__.items():
if pid[0] != '_':
......@@ -437,6 +437,12 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
#LOG( "Create createRelatedValueAccessors %s" % bid,0,'')
createRelatedValueAccessors(Base, bid)
generated_bid[bid] = 1
for ptype in portal_types.objectValues('ERP5 Type Information') :
for bid in ptype.base_category_list :
if bid not in generated_bid :
createRelatedValueAccessors(Base, bid)
generated_bid[bid] = 1
Base.aq_related_generated = 1
# Always try to return something after generation
......
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