Commit aa86e15f authored by Jean-Paul Smets's avatar Jean-Paul Smets

fixed acquisition of parent base category


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1191 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1e738ff6
...@@ -684,6 +684,16 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -684,6 +684,16 @@ class CategoryTool( UniqueObject, Folder, Base ):
portal_type = kw.get('portal_type', ()) portal_type = kw.get('portal_type', ())
if spec is (): spec = portal_type if spec is (): spec = portal_type
# We must treat parent in a different way
if base_category == 'parent':
parent = context.aq_parent # aq_inner ?
if parent.portal_type in spec:
if base:
return ['parent/' + parent.getRelativeUrl()]
else:
return [parent.getRelativeUrl()]
return []
result = [] result = []
# XXX We must use filters in the future # XXX We must use filters in the future
# query = self._buildQuery(spec, filter, kw) # query = self._buildQuery(spec, filter, kw)
...@@ -744,7 +754,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -744,7 +754,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
acquisition_sync_value -- if set to 1, keep self and looked up value in sync acquisition_sync_value -- if set to 1, keep self and looked up value in sync
""" """
#LOG("Get Acquired Category ",0,str((base_category, context))) # LOG("Get Acquired Category ",0,str((base_category, context)))
# XXX We must use filters in the future # XXX We must use filters in the future
# query = self._buildQuery(spec, filter, kw) # query = self._buildQuery(spec, filter, kw)
...@@ -786,6 +796,8 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -786,6 +796,8 @@ class CategoryTool( UniqueObject, Folder, Base ):
spec=spec, filter=filter, **kw ) spec=spec, filter=filter, **kw )
base_category_value = self.getCategoryValue(base_category) base_category_value = self.getCategoryValue(base_category)
# LOG("base_category_value",0,str(base_category_value))
# LOG("result",0,str(result))
if base_category_value is not None: if base_category_value is not None:
# If we do not mask or append, return now if not empty # If we do not mask or append, return now if not empty
if base_category_value.getAcquisitionMaskValue() and \ if base_category_value.getAcquisitionMaskValue() and \
......
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