Commit 3d666e01 authored by Sebastien Robin's avatar Sebastien Robin

if no base category specified in getCategoryMemberValueList, use getBaseCategoryId to guess one


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5809 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f7671392
...@@ -412,7 +412,7 @@ class Category(Folder): ...@@ -412,7 +412,7 @@ class Category(Folder):
can be useful to create reporting trees based on the can be useful to create reporting trees based on the
ZSQLCatalog ZSQLCatalog
""" """
#LOG('asSqlExpression', 0, str(self)) #LOG('Category.asSqlExpression self', 0, str(self))
#LOG('asSqlExpression parent', 0, str(self.aq_parent)) #LOG('asSqlExpression parent', 0, str(self.aq_parent))
if base_category is None: if base_category is None:
base_category = self base_category = self
...@@ -470,6 +470,8 @@ class Category(Folder): ...@@ -470,6 +470,8 @@ class Category(Folder):
Returns a list of objects or brains Returns a list of objects or brains
""" """
strict_membership = kw.get('strict_membership', kw.get('strict', 0)) strict_membership = kw.get('strict_membership', kw.get('strict', 0))
if base_category is None:
base_category = self.getBaseCategoryId()
return self.portal_categories.getCategoryMemberValueList(self, return self.portal_categories.getCategoryMemberValueList(self,
base_category = base_category, base_category = base_category,
spec=spec, filter=filter, portal_type=portal_type, strict_membership=strict_membership) spec=spec, filter=filter, portal_type=portal_type, strict_membership=strict_membership)
......
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